Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save PaulGwamanda/7dbf507183cf3c509fbcab34dd33afa6 to your computer and use it in GitHub Desktop.
Save PaulGwamanda/7dbf507183cf3c509fbcab34dd33afa6 to your computer and use it in GitHub Desktop.
hover over section and underline heading
//hover over section and underline heading
section{
h2 {
text-decoration: none;
letter-spacing: 0.15em;
display: inline-block;
padding: 10px 0;
position: relative;
}
h2:after {
bottom: 0;
content: "";
display: block;
height: 2px;
left: 0;
position: absolute;
background: $primary;
transition: width 0.9s ease 0s, left 0.9s ease 0s;
width: 0;
}
&:hover {
h2:after {
width: 100%;
left: 0;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment