Skip to content

Instantly share code, notes, and snippets.

@stanruss
Last active June 11, 2025 09:56
Show Gist options
  • Select an option

  • Save stanruss/6ee26e6b3b090dc4ec4643ca07290533 to your computer and use it in GitHub Desktop.

Select an option

Save stanruss/6ee26e6b3b090dc4ec4643ca07290533 to your computer and use it in GitHub Desktop.
hover btn html css
<div class="wrapper">
<a href="#!" class="hover1">hover me
<svg>
<rect></rect>
</svg>
</a>
</div>
*
padding: 0
margin: 0
.wrapper
width: 200px
margin: 50px auto
.hover1
display: block
width: 100%
height: 70px
line-height: 70px
text-decoration: none
color: black
font-family: Arial
text-transform: uppercase
font-size: 28px
letter-spacing: 3px
position: relative
text-align: center
svg
position: absolute
top: 0
left: 0
width: 100%
height: 100%
svg rect
fill: transparent
stroke: black
stroke-width: 5px
stroke-dasharray: 0px 271px 200px 70px
width: 100%
height: 100%
transition: .5s all
.hover1:hover rect
stroke-dasharray: 200px 0 70px 0 200px 0 70px 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment