Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.