CSS Reference ยท Transforms, Transitions and Animations
The transition-delay property
Reference for the CSS transition-delay property: wait before a transition starts, use negative delays and stagger effects, with syntax and live examples.
The transition-delay property sets how long the browser waits after a property changes before the transition begins. During the delay the element keeps showing its old value.
A common use is staggering: giving a series of items increasing delays so they animate one after another, instead of all at once.
.item { transition: opacity 300ms; transition-delay: 150ms; }
Try it
Each chip reads its own index from --i and multiplies it into the delay. They rise one after another from left to right, and fall back in the same order.
Syntax
transition-delay: <time># /* examples */ transition-delay: 200ms; transition-delay: 0s, 1s; transition-delay: -500ms;
- Initial value:
0s - Applies to: all elements, and the
::beforeand::afterpseudo-elements - Inherited: no
- Animatable: no
- Computed value: as specified
Values
| Value | Description |
|---|---|
<time> |
A time with a unit, s or ms. The unit is required, even for 0s. |
| Positive time | The transition starts after that long. |
| Negative time | The transition starts immediately, but as if it had already run for that long, so it begins partway through. |
| Comma-separated list | One delay per property in transition-property. |
Usage notes
- Delay applies both ways. If the base rule has a delay, it also delays the change back. To delay only the entering transition, put
transition-delayon the state rule (such as:hover), and a different value on the base rule. - Hover flicker. A long delay on
:hovermeans the user may move away before anything happens. That can be useful (hover intent for a menu) or confusing; keep delays short. - Negative delays skip ahead. A
-250msdelay on a 1s transition starts at 25% of the curve (by time), which is handy for syncing several animations. - Staggering with custom properties. Set an index per item (
--i) and computecalc(var(--i) * 100ms), as in the example, rather than writing a rule per item. - The shorthand. In
transition, the second time value is the delay and the first is the duration. - Events.
transitionrunfires when the delay starts;transitionstartfires when the delay ends and the visible change begins. - Accessibility. Long waits make an interface feel unresponsive. Keep delays under about 300 ms for interactions the user triggers.
Browser support
Supported in every browser.
Related
transitionโ the shorthandtransition-durationโ how long the change takesanimation-delayโ the same idea for keyframe animations- Lesson: Transitions