CSS Animation

Definition and Usage

Some CSS properties arecan have animation effects, which means they can be used for animations and transitions.

Animation properties can gradually change from one value to another, such as size, quantity, percentages, and colors.


Browser Support

The numbers in the table indicate the version number of the first browser that supports the method.

The -webkit-, -moz-, or -o- that follows the number specifies the browser version prefix that first supported the property.

4.0 -webkit- 10.0 16.0
5.0 -moz-
4.0 -webkit- 15.0 -webkit-
12.1
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;} }

Try it Yourself »

Animation Properties

Animation properties in CSS:

Property Example
backgroundTry it Yourself »
background-colorTry it Yourself »
background-positionTry it Yourself »
background-sizeTry it Yourself »
borderTry it Yourself »
border-bottomTry it Yourself »
border-bottom-colorTry it Yourself »
border-bottom-left-radiusTry it Yourself »
border-bottom-right-radiusTry it Yourself »
border-bottom-widthTry it Yourself »
border-colorTry it Yourself »
border-leftTry it Yourself »
border-left-colorTry it Yourself »
border-left-widthTry it Yourself »
border-rightTry it Yourself »
border-right-colorTry it Yourself »
border-right-widthTry it Yourself »
border-spacingTry it Yourself »
border-topTry it Yourself »
border-top-colorTry it Yourself »
border-top-left-radiusTry it Yourself »
border-top-right-radiusTry it Yourself »
border-top-widthTry it Yourself »
bottomTry it Yourself »
box-shadowTry it Yourself »
clipTry it Yourself »
colorTry it Yourself »
column-countTry it Yourself »
column-gapTry it Yourself »
column-ruleTry it Yourself »
column-rule-colorTry it Yourself »
column-rule-widthTry it Yourself »
column-widthTry it Yourself »
columnsTry it Yourself »
filterTry it Yourself »
flex 
flex-basisTry it Yourself »
flex-growTry it Yourself »
flex-shrinkTry it Yourself »
fontTry it Yourself »
font-sizeTry it Yourself »
font-size-adjust 
font-stretch 
font-weightTry it Yourself »
heightTry it Yourself »
leftTry it Yourself »
letter-spacingTry it Yourself »
line-heightTry it Yourself »
marginTry it Yourself »
margin-bottomTry it Yourself »
margin-leftTry it Yourself »
margin-rightTry it Yourself »
margin-topTry it Yourself »
max-heightTry it Yourself »
max-widthTry it Yourself »
min-heightTry it Yourself »
min-widthTry it Yourself »
opacityTry it Yourself »
orderTry it Yourself »
outlineTry it Yourself »
outline-colorTry it Yourself »
outline-offsetTry it Yourself »
outline-widthTry it Yourself »
paddingTry it Yourself »
padding-bottomTry it Yourself »
padding-leftTry it Yourself »
padding-rightTry it Yourself »
padding-topTry it Yourself »
perspectiveTry it Yourself »
perspective-originTry it Yourself »
rightTry it Yourself »
text-decoration-colorTry it Yourself »
text-indentTry it Yourself »
text-shadowTry it Yourself »
topTry it Yourself »
transformTry it Yourself »
transform-originTry it Yourself »
vertical-alignTry it Yourself »
visibility 
widthTry it Yourself »
word-spacingTry it Yourself »
z-indexTry it Yourself »
other extensions