CSS animation-name Property
Description
The animation-name property in CSS is a fundamental part of defining animations for HTML elements. It allows you to assign one or more keyframe animations to an element by referencing the names of the @keyframes rules defined elsewhere in your stylesheet. By specifying an animation name, you essentially tell the browser which set of keyframes should be applied to the element, giving you full control over how the element changes over time. Without this property, even if other animation-related properties like animation-duration or animation-timing-function are set, no visual transformation would occur because the browser would not know which keyframes to execute.
Using animation-name allows for modularity and reusability in CSS animations. You can define multiple keyframe sequences with different names and then apply them selectively to different elements by assigning the corresponding animation names. This approach promotes cleaner code and reduces repetition, especially when multiple elements share similar animation behaviors. For instance, you might have a keyframe animation called "fadeIn" for making elements gradually appear and another called "slideUp" for vertical movement. Applying these animations only requires referencing their names in animation-name, making it easy to manage complex animations across a site.
Additionally, animation-name works in combination with several other animation properties to create dynamic effects. Properties like animation-duration, animation-delay, and animation-iteration-count determine the timing, repetition, and sequencing of the named keyframes, allowing designers to fine-tune the behavior of animations. The separation of the animation definition (via @keyframes) and its application (via animation-name) provides flexibility, making it possible to apply the same animation to multiple elements with different durations, delays, or directions, resulting in visually appealing and efficient animations.
Definition
- Initial value
- none
- Applies to
- All elements, :before and :after pseudo elements
- Inherited
- No
- Computed value
- As specified
- Animatable
- No
- JavaScript syntax
- object.style.animationName
Interactive Demo
Syntax
animation-name: <single-animation-name> [ ',' <single-animation-name> ]*
Values
- noneIs a special keyword denoting no keyframes. It can be used to deactivate an animation without changing the ordering of the other identifiers, or to deactivate animations coming from the cascade.
- <IDENT>A string identifying the animation. This identifier is composed by a combination of case-insensitive letters a to z, numbers 0 to 9, underscores (_), and/or dashes (-). The first non-dash character must be a letter (that is, no number at the beginning of it, even if preceded by a dash.) Also, two dashes are forbidden at the beginning of the identifier.
Example
Browser Support
The following information will show you the current browser support for the CSS animation-name property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
