Example
Make the animation complete in two seconds:
div {
-webkit-animation-duration: 2s; /* Chrome, Safari, Opera */
animation-duration: 2s;
}
Try it Yourself »
Definition and Usage
The animation-duration property defines how many seconds or milliseconds an animation takes to complete one cycle.
Default value: | 0 |
---|---|
Inherited: | no |
Animatable: | no. Read about animatable |
Version: | CSS3 |
JavaScript syntax: | object.style.animationDuration="3s" Try it |
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
Numbers followed by -webkit-, -moz-, or -o- specify the first version that worked with a prefix.
Property | |||||
---|---|---|---|---|---|
animation-duration | 43.0 3.0 -webkit- |
10.0 | 16.0 5.0 -moz- |
9.0 4.0 -webkit- |
30.0 15.0 -webkit- 12.0 -o- |
CSS Syntax
animation-duration: time|initial|inherit;
Property Values
Value | Description | Play it |
---|---|---|
time | Specifies the length an animation takes to finish. Default value is 0, meaning there will be no animation | Play it » |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
Related Pages
CSS3 tutorial: CSS3 Animations
HTML DOM reference: animationDuration property