CKTIS / CSS
transition-duration — transition length
The transition-duration property sets how long a CSS transition changes a value, separately from its delay.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
transition-duration: <time [0s,∞]>#;transition-duration sets the time taken to transition between values. It accepts nonnegative times in s or ms; a negative value invalidates the declaration. The initial value, 0s, means no gradual change. The property is not inherited.
Comma-separated durations match positions in transition-property: shorter lists repeat, and excess entries are ignored. transition-delay controls the delay separately. Setting a duration alone does not start a transition: a change between transitionable values is also necessary.
Examples
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>transition-duration</title>
<style>
button {
opacity: 1;
transition-property: opacity;
transition-duration: 600ms;
transition-timing-function: linear;
transition-delay: 0s;
}
button:hover,
button:focus {
opacity: 0.4;
}
</style>
<button type="button">Hover or focus</button>
</html>Result
Opacity changes from 1 to 0.4 over 600ms on hover or focus, and returns to 1 over 600ms when neither state applies, provided the previous transition completed.
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.