CSS Animation
Definition and Usage
Some CSS properties are animatable, meaning they can be used for animations and transitions.
Animatable properties can gradually change from one value to another, such as size, number, percentage, and color.
Browser Support
The numbers in the table specify the first browser version that supports the method.
The prefixes -webkit-, -moz-, or -o- following the numbers indicate the first browser version that supported the property with a prefix.
4.0 -webkit- | 10.0 | 16.0 <br>5.0 -moz- | 4.0 -webkit- | 15.0 -webkit- <br>12.1 <br>12.0 -o- |
Example
The background color gradually changes from red to blue:
@keyframes mymove {
from {background-color: red;}
to {background-color: blue;}
}
/* Safari and Chrome: */
@-webkit-keyframes mymove {
from {background-color: red;}
to {background-color: blue;}
}
Animation Properties
Animation properties in CSS: