The animation-name property chooses which @keyframes rule an element runs. The name is case-sensitive. If it does not match a keyframes rule, nothing animates.
The initial value is none. The property is not inherited, and it is not animatable: a new name takes effect in one step and restarts the animation. It applies to any element, including ::before and ::after.
Standard-track.
Not deprecated and not experimental. Baseline widely available since September 2015. Current browsers use the unprefixed property.
Syntax
CSS Syntax
One name, or a comma-separated list. A name is an identifier such as slide, or a quoted string such as "slide".
Name the motion.@keyframes slide stores a move to the right and back under the name slide.
Point at that name.animation-name: slide tells the div to use those keyframes. Slide or SLIDE would not match.
Give it time.animation-duration: 2s is what makes the move visible. The default duration is 0s.
Keep it on screen.animation-iteration-count: infinite repeats the move so you can study it. The count does not choose which animation runs. The name does.
Example 2 — Turn an Animation Off
Same keyframes and the same duration. Only the name changes.
Two rules.slide changes transform. fade changes opacity.
List the names.animation-name: slide, fade runs both, in that order. A space without a comma is invalid and drops the declaration.
One duration covers both. A single 2s is repeated for every name that does not have its own time.
They share the element. Move and fade run together. One does not replace the other.
Edge Cases & Pitfalls
If the box sits still, one of these is usually why.
case
The name must match exactly
Slide does not match @keyframes slide. A typo still occupies a slot in a list, so the next duration stays paired with the wrong name.
0s
A name with no duration looks idle
animation-duration starts at 0s. The keyframes run, then finish before you can see them. Set a duration above zero.
short
The shorthand can clear the name
animation: 1s linear omits the name, so animation-name resets to none. Put the name in the shorthand, or set animation-name after it.
list
Shorter lists repeat
One name and two durations run that animation twice. Two names and one duration give both names the same duration. none in the middle of a list disables that slot only.
motion
Some people need less motion
A looping animation can be hard to read. prefers-reduced-motion is how a visitor asks for less motion. Offer a still state when that query matches.
Compatibility
Browser Support
animation-name is a browser animation property. Node.js, Deno, and Bun do not apply it.
✓ Baseline · Since Sep 2015
animation-name
Unprefixed: Chrome 43+, Firefox 16+, Safari 9+, Edge 12+, Opera 30+. Internet Explorer 10+. Samsung Internet 4+.
98%Unprefixed support
Google Chrome43+ · 3+ with -webkit-
Full support
Mozilla Firefox16+ · 5+ with -moz-
Full support
Apple Safari9+ · 4+ with -webkit-
Full support
Microsoft Edge12+
Full support
Opera30+ · 15+ with -webkit-
Full support
Samsung Internet4+
Full support
Internet Explorer10+
Full support
animation-nameWidely supported
Bottom line: Safe unprefixed in current browsers. Safari 4–8, Chrome 3–42, and Firefox 5–15 needed a prefix on both animation-name and @keyframes. Internet Explorer 10 supports the property and plain names. Quoted names are for current browsers.
Remember
Key Takeaways
Role: choose the @keyframes rule. The name does not describe the motion by itself.
Match: same spelling and same case as @keyframes. none means no keyframes.
Duration: set animation-duration above 0s or the name looks idle.
Lists: commas run several animations. A shorter timing list repeats. The property is not inherited.
One line:animation-name only picks the @keyframes rule. Pair it with a duration, or the box will not appear to move.
Frequently Asked Questions
It chooses which @keyframes rule an element runs. The name must match the keyframes name exactly, including letter case. If nothing matches, nothing animates.
The initial value is none. No keyframes run until you set a name. The property is not inherited.
The usual cause is animation-duration. Its default is 0s, so the animation finishes before you can see it. A mismatched or differently cased name also runs nothing.
Yes. Separate names with commas, such as slide, fade. Other animation properties pair with those names in the same order. A shorter list is repeated until every name has a value.
Yes. The name is one value in the animation shorthand. If you omit it, the shorthand resets animation-name to none and the animation does not run.
Unprefixed support is Chrome 43+, Firefox 16+, Safari 9+, Edge 12+, and Opera 30+. Internet Explorer 10 and Samsung Internet 4 also support it. It is a browser property. Node.js, Deno, and Bun do not apply it.