Created
January 28, 2012 11:28
-
-
Save geoffreycrofte/1694007 to your computer and use it in GitHub Desktop.
Loader : demo of pseudo-element animation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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; } | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="#">Hover me</a> | |
<span></span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"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