div {
transition: <property> <duration> <timing-function> <delay>;
}
div {
transition: <property> <duration> <timing-function> <delay>;
}
Any CSS property that can be interpolated
INTERPOLATES width: 0px --> 100px background: #r00 --> #00r margin: 1em --> 2em DOESN'T Display: none -/-> block Float: right -/-> left
div {
transition: <property> <duration> <timing-function> <delay>;
}
Specifies the duration over which transitions should occur
300ms 2s
Looks really nice!
div {
transition: <property> <duration> <timing-function> <delay>;
}
Timing functions determine how intermediate values of the transition are calculated
div {
transition: <property> <duration> <timing-function> <delay>;
}
Defines how long to wait between the time a property is changed and the transition actually begins.
300ms 2s
links that change color on hover
Icon that rotates when clicked
Input borders change when focused
progress bar
Element that follows the mouse
@keyframe rules define the state of the animation as it happens through time.
keyframes use percentages or "to" and "from" to show the state at a given "key" moments -- and the other values are interpolated.
p {
animation-duration: 3s;
animation-name: slidein;
}
@keyframes slidein {
from {
margin-left: 100%;
width: 300%;
}
to {
margin-left: 0%;
width: 100%;
}
}
(animating between states)