Skip to content

Instantly share code, notes, and snippets.

@chriscoyier
Created December 19, 2011 22:43
Show Gist options
  • Save chriscoyier/1499252 to your computer and use it in GitHub Desktop.
Save chriscoyier/1499252 to your computer and use it in GitHub Desktop.
Transitions
/* Transitions */
div {
background: black;
width: 200px;
padding: 10px;
margin: 20px 0;
color: white
}
div:hover {
width: 500px;
}
div:nth-child(n+3):hover { width: 208px; }
div:nth-child(1) { transition: 0.4s ease; }
div:nth-child(2) { transition: 0.4s linear; }
div:nth-child(3) { transition: 0.4s ease; }
div:nth-child(4) { transition: 0.4s linear; }
<div>Long / Ease (nice)</div>
<div>Long / Linear (stiff)</div>
<div>Short / Ease (jerky)</div>
<div>Short / Linear (nice)</div>
{"page":"css","view":"split"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment