Skip to content

Instantly share code, notes, and snippets.

@geoffreycrofte
Created January 21, 2012 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save geoffreycrofte/1653135 to your computer and use it in GitHub Desktop.
Save geoffreycrofte/1653135 to your computer and use it in GitHub Desktop.
Animation in pseudo-element
/**
* Animation in pseudo-element
*/
div {
height: 100px;
background: #eee;
}
div:before {
content:" ";
display:inline-block;
width: 200px; height: 100px;
background: #fff;
vertical-align: middle;
transition: width 1s;
}
div:hover:before {
width: 240px;
}
<div>Hello World!</div>
{"view":"split","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment