Let the transition effect last for 5 seconds:
div {
transition-duration: 5s;
}
Try it Yourself »
The transition-duration
property specifies how many seconds (s) or milliseconds (ms) a transition effect takes to complete.
Default value: | 0s |
---|---|
Inherited: | no |
Animatable: | no. Read about animatable |
Version: | CSS3 |
JavaScript syntax: | object.style.transitionDuration="1s" 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 | |||||
---|---|---|---|---|---|
transition-duration | 26.0 4.0 -webkit- |
10.0 | 16.0 4.0 -moz- |
6.1 3.1 -webkit- |
12.1 10.5 -o- |
transition-duration:
time|initial|inherit;
Value | Description |
---|---|
time | Specifies how many seconds or milliseconds a transition effect takes to complete. Default value is 0s, meaning there will be no effect |
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 Transitions
HTML DOM reference: transitionDuration property
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!