Specify that the animation should complete one cycle in 3 seconds:
div {
animation-duration: 3s;
}
Try it Yourself »
The animation-duration
property defines how long an animation should take to complete one cycle.
Default value: | 0 |
---|---|
Inherited: | no |
Animatable: | no. Read about animatable |
Version: | CSS3 |
JavaScript syntax: | object.style.animationDuration="3s" Try it |
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- |
animation-duration:
time|initial|inherit;
Value | Description | Demo |
---|---|---|
time | Specifies the length of time an animation should take to complete one cycle. This can be specified in seconds or milliseconds. Default value is 0, which means that no animation will occur | Play it » |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
CSS tutorial: CSS Animations
HTML DOM reference: animationDuration property
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!