Definition and Usage
The transition-duration CSS property specifies the number of seconds or milliseconds a transition animation should take to complete. By default, the value is 0s, meaning that no animation will occur.
You may specify multiple durations; each duration will be applied to the corresponding property as specified by the transition-property property, which acts as a master list. If there are fewer durations specified than in the master list, the user agent repeat the list of durations. If there are more durations, the list is simply truncated to the right size. In both case the CSS declaration stays valid.
- Initial 0s
- Applies to all elements, ::before and ::after pseudo-element
- Inherited no
- Media interactive
- Computed Value as specified
- Animatable no
- Canonical order the unique non-ambiguous order defined by the formal grammar
Syntax
Formal syntax: <time>#
transition-duration: 6s transition-duration: 120ms transition-duration: 1s, 15s transition-duration: 10s, 30s, 230ms transition-duration: inherit
Values
- <time>
- Is a <time> denoting the amount of time the transition from the old value of a property to the new value should take. A time of 0s indicates that no transition will happen, that is the switch between the two states will be instantaneous. A negative value for the time renders the declaration invalid.
Examples
No examples
Compatibility
Desktop browsers
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 1.0 -webkit | 4.0 (2.0) -moz 16.0 (16.0) | 10.0 | 11.6 -o 12.10 | 3.0 -webkit |
Mobile browsers
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | 2.1 -webkit | 4.0 (2.0) -moz 16.0 (16.0) | NA | 10.0 -o 12.10 | 3.2 -webkit |