Skip to content

Instantly share code, notes, and snippets.

@geoffreycrofte
Created January 28, 2012 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geoffreycrofte/1694007 to your computer and use it in GitHub Desktop.
Save geoffreycrofte/1694007 to your computer and use it in GitHub Desktop.
Loader : demo of pseudo-element animation
/**
* Loader : demo of pseudo-element animation
*/
a { display:inline-block; margin-top: 3em}
span {
display:block;
position: relative;
width: 400px;
height: 5px;
border: 1px solid #ddd;
background: linear-gradient(#ddd,#fff);
margin: 1em;
}
span:after {
position: absolute;
top: -1px; left: -1px;
content:"";
height: 5px;
width: 0;
border: 1px solid green;
background: linear-gradient(rgb(0,255,0), rgb(0,150,0));
transition: width 5s;
}
a:hover + span:after { width: 400px; }
<a href="#">Hover me</a>
<span></span>
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment