Skip to content

Instantly share code, notes, and snippets.

@LaunchedBerry07
Created August 27, 2022 19:14
Show Gist options
  • Save LaunchedBerry07/a987e7480616d446da80757bbd8bac56 to your computer and use it in GitHub Desktop.
Save LaunchedBerry07/a987e7480616d446da80757bbd8bac56 to your computer and use it in GitHub Desktop.
100 days css Button N° 045
<div class="container">
<div class="center">
<button class="btn">
<svg width="180px" height="60px" viewBox="0 0 180 60" class="border">
<polyline points="179,1 179,59 1,59 1,1 179,1" class="bg-line" />
<polyline points="179,1 179,59 1,59 1,1 179,1" class="hl-line" />
</svg>
<span>HOVER ME</span>
</button>
</div>
</div>
@import url('https://fonts.googleapis.com/css?family=Lato:100&display=swap');
body, html {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
background: #5CA4EA;
overflow: hidden;
font-family: 'Lato', sans-serif;
}
.container {
width: 400px;
height: 400px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
display: flex;
justify-content: center;
align-items: center;
}
.center {
width: 180px;
height: 60px;
position: absolute;
}
.btn {
width: 180px;
height: 60px;
cursor: pointer;
background: transparent;
border: 1px solid #91C9FF;
outline: none;
transition: 1s ease-in-out;
}
svg {
position: absolute;
left: 0;
top: 0;
fill: none;
stroke: #fff;
stroke-dasharray: 150 480;
stroke-dashoffset: 150;
transition: 1s ease-in-out;
}
.btn:hover {
transition: 1s ease-in-out;
background: #4F95DA;
}
.btn:hover svg {
stroke-dashoffset: -480;
}
.btn span {
color: white;
font-size: 18px;
font-weight: 100;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment