Skip to content

Instantly share code, notes, and snippets.

@LeaVerou
Last active March 4, 2018 00:12
Show Gist options
  • Save LeaVerou/1dd8d43442e11b7c5822ae19ad10e3e9 to your computer and use it in GitHub Desktop.
Save LeaVerou/1dd8d43442e11b7c5822ae19ad10e3e9 to your computer and use it in GitHub Desktop.
Text-underline-animation
/**
* Text-underline-animation
*/
a {
font-size: 500%;
text-decoration: none;
background: linear-gradient(currentColor, currentColor) bottom / 0 .1em no-repeat;
transition: 1s background-size;
}
a:hover {
background-size: 100% .1em;
}
/* Variations */
a.left {
background-position: left bottom;
}
a.right {
background-position: right bottom;
}
<p>Hover over the following links:
<p><a href="http://lea.verou.me" class="left">From left</a>
<p><a href="http://lea.verou.me" class="center">From center</a>
<p><a href="http://lea.verou.me" class="right">From right</a>
// alert('Hello world!');
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"","page":"css"}
@himanshub16
Copy link

Made my day! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment