The animation-duration property sets how long one cycle of an animation takes. The same @keyframes look faster with a short time and slower with a long time.
You still need an animation-name. The initial value is 0s, so without a positive duration you usually see no motion. It applies to all elements, including ::before and ::after, and it is not inherited. A duration does not remove motion for someone who set prefers-reduced-motion.
Standard-track.
Not deprecated. Time values in s and ms have been widely available since 2015. The auto keyword is newer and mainly matters for scroll-driven timelines; for a normal clock animation it acts like 0s.
Any time with a unit, in seconds or milliseconds. Zero is allowed. Negative times are invalid. For several animations, separate the times with commas, in the same order as the names.
Values
Property Values
Value
Description
Try it
0s
Initial value. The cycle ends at once. With the default fill mode, you usually see no motion
Share the animation. Both lines use fade and repeat forever.
Give each a duration. Fast uses 1s. Slow uses 3s.
Same path, different clock. The keyframes are identical. Only the length of one cycle changes.
Read the difference. Slow looks calmer because each play lasts three times as long.
Edge Cases & Pitfalls
If nothing moves, the duration or the unit is usually why.
0s
The default looks still
The initial value is 0s. Events can still fire, but with the default animation-fill-mode of none you usually see no change. Set a positive time.
unit
A number alone is invalid
animation-duration: 1 is ignored. Write 1s or 1000ms. The unit is required.
minus
Negative times are invalid
Unlike animation-delay, a negative duration is dropped. Use 0s or a positive time.
order
The shorthand can wipe the duration
animation: fade without a time resets duration to 0s. Put the time in the shorthand, or write animation-duration after it.
list
One time per animation name
animation-duration: 1s, 3s follows the order of animation-name. Fewer times than names, and the list repeats.
Compatibility
Browser Support
animation-duration is a browser style property. Node.js, Deno, and Bun do not play it. The versions below are for time values in s and ms.
✓ Baseline · Widely available since 2015
animation-duration
Chrome 43+, Firefox 16+, Safari 9+, Edge 12+, Internet Explorer 10+. The auto keyword is newer (Chrome 115+, Safari 18.4+, Firefox 161+) and is not part of these numbers.
97%time values
Google Chrome43+
Full support
Mozilla Firefox16+
Full support
Apple Safari9+
Full support
Microsoft Edge12+
Full support
Opera30+
Full support
Samsung Internet4+
Full support
Internet Explorer10+
Full support
animation-durationWidely supported
Bottom line: Older Chrome, Safari, and Firefox also accepted a prefixed property. Use a positive time with a unit for everyday animations. Treat auto as a newer scroll-timeline detail, not the default you teach first.
Remember
Key Takeaways
Role: how long one play of an animation lasts.
0s: the initial value. Usually no visible motion until you set a positive time.
Units:1s or 500ms. A bare number does nothing.
Not delay: duration is the length of the play. Delay is the wait before it.
One line: name the animation, then animation-duration sets the clock for one cycle.
Frequently Asked Questions
It sets how long one complete cycle of an animation takes. A longer time makes the same keyframes look slower. A shorter time makes them look faster.
The initial value is 0s. The animation still runs in the sense that start and end events fire, but with the default fill mode you usually see no motion.
Yes. Use seconds (s) or milliseconds (ms). 500ms is the same length as 0.5s. The unit is required.
Duration is how long one play lasts. Delay is how long to wait before that play starts. They are different properties.
No. A negative time is invalid and the declaration is ignored. Use 0s or a positive time with a unit.
Chrome 43+, Firefox 16+, Safari 9+, Edge 12+, and Internet Explorer 10 support time values in s and ms. It is a browser style property, not a Node.js feature. The auto keyword is newer.