CSS: animation-delay
The animation-delay property sets how long the browser waits before starting a keyframe animation.
What you will learn
- How to delay an animation with a time value
- What a negative delay means
- Why delayed essential feedback can hurt usability
Basic example
.notice {
animation: appear 300ms ease-out;
animation-delay: 200ms;
}
@keyframes appear {
from { opacity: 0; }
to { opacity: 1; }
}A positive delay waits before the animation starts. A negative delay starts as if the animation had already been running for that amount of time.
Common mistakes
- Do not delay important feedback so long that users miss it.
- Test delayed motion when the user prefers reduced motion.
- Use
animation-fill-modeif the pre-animation state must be controlled.