The animation-name property connects an element to a named @keyframes animation. Without a matching name, the keyframes exist in CSS but nothing runs on the page.
01
Link Keyframes
Apply named animations.
02
Syntax
Custom keyframe names.
03
none
No animation applied.
04
@keyframes
Define motion first.
05
Multiple Names
Run more than one animation.
06
Shorthand
Name comes first.
Fundamentals
Definition and Usage
The animation-name CSS property specifies which @keyframes animation should run on an element. You first define the animation steps with @keyframes, then use animation-name to attach that animation to a selector.
Think of @keyframes as writing the script and animation-name as choosing which actor performs it. You still need properties like animation-duration for the animation to be visible.
💡
Beginner Tip
The name in animation-name: fadeIn; must exactly match @keyframes fadeIn { ... }, including capitalization.
Foundation
📝 Syntax
Set animation-name to none or one or more custom keyframe names:
The initial value is none, meaning no animation is applied.
The value must match a name declared in a @keyframes rule.
Keyframe names are case-sensitive: fadeIn and fadein are different.
You can list multiple names separated by commas for multiple simultaneous animations.
In the animation shorthand, the name is always the first value.
Cheat Sheet
⚡ Quick Reference
Question
Answer
Initial value
none
Applies to
All elements
Inherited
No
Animatable
No
Common use
Connecting elements to named @keyframes animations
Defaults
Default Value
The initial value of animation-name is none. No animation runs until you assign a valid keyframe name and provide the other required animation properties.
Reference
💎 Property Values
These are the values you will use when applying named animations.
Value
Example
Meaning
none
animation-name: none;
No animation is applied to the element
Keyframe name
animation-name: fadeIn;
Uses the animation defined in @keyframes fadeIn
Multiple names
animation-name: fadeIn, slideUp;
Runs two animations on the same element
initial
animation-name: initial;
Resets to the default value none
inherit
animation-name: inherit;
Inherits the animation name from the parent element
changeColor
The element uses the @keyframes changeColor animation to shift background color.
@keyframes changeColor
Name must match exactly in both places.
slideIn
The same property can reference a movement animation defined separately in CSS.
@keyframes slideIn
Reuse one keyframe block on many selectors.
fadePulse
Different names let you organize animations by purpose, such as pulse, bounce, or fade.
@keyframes fadePulse
Choose descriptive names for easier maintenance.
Connection
How animation-name Works with @keyframes
Every animation needs two parts working together:
Step
CSS rule
Role
1. Define
@keyframes fadeIn { ... }
Creates the animation steps and timing points
2. Apply
animation-name: fadeIn;
Chooses which keyframe set the element uses
3. Configure
animation-duration: 1s;
Sets how long the named animation runs
Compare
@keyframes vs animation-name
Rule / Property
What it does
Analogy
@keyframes
Defines the animation steps
Writing the script
animation-name
Selects which keyframes to use
Choosing which actor performs it
Preview
👀 Live Preview
This box uses a named keyframe animation via animation-name:
The background shifts between blue and green because the element is linked to matching @keyframes defined in CSS.
Hands-On
Examples Gallery
Try animation-name with a color animation, slide-in motion, multiple names, and shorthand syntax.
📚 Named Animations
Start by defining @keyframes, then connect them with animation-name.
Example 1 — Background Color Animation
Define @keyframes changeColor and apply it to a div with animation-name.
In animation: fadeIn 0.5s ease-out forwards, the first value fadeIn is the animation name.
🧠 How animation-name Works
1
You create @keyframes
Define the animation steps under a custom name such as fadeIn.
Define
2
You set animation-name
Point the element to that keyframe name with animation-name: fadeIn;.
Connect
3
You add timing properties
Set duration, delay, iteration count, and fill mode so the named animation becomes visible.
Configure
=
🎬
Animated element
The browser runs the selected keyframes on the element using your animation settings.
Compatibility
Universal Browser Support
animation-name is supported in all modern browsers alongside CSS animations and @keyframes.
✓ Baseline · CSS Animations
Apply named animations in modern browsers
Chrome, Firefox, Safari, Edge, and Opera all support custom animation names and multiple comma-separated names.
98%Modern browser support
Google Chrome43+ · Desktop & Mobile
Full support
Mozilla Firefox16+ · Desktop & Mobile
Full support
Apple Safari9+ · macOS & iOS
Full support
Microsoft Edge12+ · Modern versions
Full support
Opera30+ · Modern versions
Full support
Legacy browsers
Very old browsers without CSS animation support also lack animation-name.
💻
Internet ExplorerIE 9 and earlier · No CSS animation support
None
animation-name property98% supported
Bottom line: Define clear keyframe names and use the same spelling in animation-name for reliable results.
Wrap Up
Conclusion
The animation-name property is the link between your @keyframes definitions and the elements that should animate. Without it, even well-written keyframes will not run.
Define descriptive names like fadeIn, slideUp, or spin, connect them with animation-name, and combine with duration and iteration settings to bring your UI to life.