CSS Reference ยท Transforms, Transitions and Animations
The animation-delay property
Reference for the CSS animation-delay property: wait before an animation starts, use negative delays to start midway, stagger items, with syntax and examples.
The animation-delay property sets when an animation starts, measured from the moment it is applied to the element (for example when the page loads or a class is added). Until the delay is over, the element shows its normal styles, unless animation-fill-mode says otherwise.
The delay happens once, at the start. It is not repeated for each iteration.
.toast { animation: slide-in 400ms ease-out; animation-delay: 1s; }
Try it
The purple bars ripple because each one starts a little later. The teal bar has a negative delay, so it is not at its first keyframe when it appears.
Syntax
animation-delay: <time># /* examples */ animation-delay: 2s; animation-delay: 250ms, 1s; animation-delay: -1s;
- 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 zero. |
| Positive value | The animation starts after that long. |
| Negative value | The animation starts at once, but as if it had been running for that long. |
| Comma-separated list | One delay per name in animation-name. |
Usage notes
- Before the start. During a positive delay the element does not show the first keyframe unless you set
animation-fill-mode: backwards(orboth). Without it, the element sits in its normal style and then jumps to the first keyframe when the animation begins. This is the most common reason for a visible flash. - Negative delays are useful. They let several looping animations start out of phase immediately, with no waiting. Staggered loaders and sparkles often use them.
- Stagger with a custom property.
animation-delay: calc(var(--i) * 100ms)with an index per item avoids writing a rule per element. - One delay per animation. When you have several names, give the delay list in the same order, or one value to share.
- Not repeated. If you want a pause between every loop, build the pause into the keyframes (for example by holding the last value between 80% and 100%).
- Events.
animationstartfires when the delay ends, not when the animation is applied. - Accessibility. Long delays can make interface changes feel broken; keep delays for decoration and avoid hiding important content behind them.
Browser support
Supported in every browser.
Related
animationโ the shorthand (the second time value is the delay)animation-fill-modeโ styles during the delayanimation-durationโ how long each cycle runstransition-delayโ the same idea for transitions- Lesson: Animations