transition-duration CSS property sets the length of time a transition animation should take to complete. By default, the value is
0s, meaning that no animation will occur.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
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 truncated to the right size. In both case the CSS declaration stays valid.
/* <time> values */ transition-duration: 6s; transition-duration: 120ms; transition-duration: 1s, 15s; transition-duration: 10s, 30s, 230ms; /* Global values */ transition-duration: inherit; transition-duration: initial; transition-duration: unset;
- 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
0sindicates 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.
|Applies to||all elements, |
|Computed value||as specified|
The definition of 'transition-duration' in that specification.
|Working Draft||Initial definition|
BCD tables only load in the browser