- CSS Tutorial
- CSS - Home
- CSS - Introduction
- CSS - Syntax
- CSS - Selectors
- CSS - Inclusion
- CSS - Measurement Units
- CSS - Colors
- CSS - Backgrounds
- CSS - Fonts
- CSS - Text
- CSS - Images
- CSS - Links
- CSS - Tables
- CSS - Borders
- CSS - Border Block
- CSS - Border Inline
- CSS - Margins
- CSS - Lists
- CSS - Padding
- CSS - Cursor
- CSS - Outlines
- CSS - Dimension
- CSS - Scrollbars
- CSS - Inline Block
- CSS - Dropdowns
- CSS - Visibility
- CSS - Overflow
- CSS - Clearfix
- CSS - Float
- CSS - Arrows
- CSS - Resize
- CSS - Quotes
- CSS - Order
- CSS - Position
- CSS - Hyphens
- CSS - Hover
- CSS - Display
- CSS - Focus
- CSS - Zoom
- CSS - Translate
- CSS - Height
- CSS - Hyphenate Character
- CSS - Width
- CSS - Opacity
- CSS - Z-Index
- CSS - Bottom
- CSS - Navbar
- CSS - Overlay
- CSS - Forms
- CSS - Align
- CSS - Icons
- CSS - Image Gallery
- CSS - Comments
- CSS - Loaders
- CSS - Attr Selectors
- CSS - Combinators
- CSS - Root
- CSS - Box Model
- CSS - Counters
- CSS - Clip
- CSS - Writing Mode
- CSS - Unicode-bidi
- CSS - min-content
- CSS - All
- CSS - Inset
- CSS - Isolation
- CSS - Overscroll
- CSS - Justify Items
- CSS - Justify Self
- CSS - Tab Size
- CSS - Pointer Events
- CSS - Place Content
- CSS - Place Items
- CSS - Place Self
- CSS - Max Block Size
- CSS - Min Block Size
- CSS - Mix Blend Mode
- CSS - Max Inline Size
- CSS - Min Inline Size
- CSS - Offset
- CSS - Accent Color
- CSS - User Select
- CSS Advanced
- CSS - Grid
- CSS - Grid Layout
- CSS - Flexbox
- CSS - Visibility
- CSS - Positioning
- CSS - Layers
- CSS - Pseudo Classes
- CSS - Pseudo Elements
- CSS - @ Rules
- CSS - Text Effects
- CSS - Paged Media
- CSS - Printing
- CSS - Layouts
- CSS - Validations
- CSS - Image Sprites
- CSS - Important
- CSS - Data Types
- CSS3 Tutorial
- CSS3 - Tutorial
- CSS - Rounded Corner
- CSS - Border Images
- CSS - Multi Background
- CSS - Color
- CSS - Gradients
- CSS - Box Shadow
- CSS - Box Decoration Break
- CSS - Caret Color
- CSS - Text Shadow
- CSS - Text
- CSS - 2d transform
- CSS - 3d transform
- CSS - Transition
- CSS - Animation
- CSS - Multi columns
- CSS - Box Sizing
- CSS - Tooltips
- CSS - Buttons
- CSS - Pagination
- CSS - Variables
- CSS - Media Queries
- CSS - Functions
- CSS - Math Functions
- CSS - Masking
- CSS - Shapes
- CSS - Style Images
- CSS - Specificity
- CSS - Custom Properties
- CSS Responsive
- CSS RWD - Introduction
- CSS RWD - Viewport
- CSS RWD - Grid View
- CSS RWD - Media Queries
- CSS RWD - Images
- CSS RWD - Videos
- CSS RWD - Frameworks
- CSS References
- CSS - Questions and Answers
- CSS - Quick Guide
- CSS - References
- CSS - Color References
- CSS - Web browser References
- CSS - Web safe fonts
- CSS - Units
- CSS - Animation
- CSS Resources
- CSS - Useful Resources
- CSS - Discussion
CSS - animation-name Property
The CSS property animation-name identifies the @keyframes rules that define the animation of an element. These rules, which are listed as a comma-separated sequence, describe the animation behavior. If a specified name doesn't correspond to any @keyframes rule, no properties are animated.
The shorthand property animation proves to be practical, as it enables the simultaneous configuration of all animation-related properties.
Possible Values
The CSS property animation-name can have one of the following values:
none - A specific term indicating the absence of keyframes. It's used to disable an animation without changing the order of the other identifiers, or to disable animations inherited from the cascade.
<custom-ident> - This identifier names the animation with a combination of upper and lower case letters from a to z, numbers from 0 to 9, underscores (_) and/or hyphens (-). The first character, with the exception of hyphens, must be a letter.
In addition, the identifier must not begin with two hyphens, and certain keywords like none, unset, initial, or inherit cannot be used as identifiers.
Note: When multiple comma-separated values on an animation-* property is specified, the values are applied to the animations in the order in which the animation-names appear.
Syntax
animation-name = [ none | <keyframes-name> ]# <keyframes-name> = <custom-ident> | <string>
Applies To
All the HTML elements, ::before and ::after pseudo-elements.
CSS animation-name - Assigning Name
In the example, animation-name: slide; denotes the animation sequence defined in @keyframes slide {...} for use with the .box element.
This property creates a link that allows the element to access and apply the named animation that moves the box horizontally using the translateX transformation.
Through this link, the animation name property allows the target element to execute the specified animation sequence.
<html> <head> <style> @keyframes slide { 0% { transform: translateX(0); } 100% { transform: translateX(300px); } } .box { width: 100px; height: 100px; background-color: teal; animation-name: slide; /* Assigning the animation name */ animation-duration: 2s; animation-iteration-count: infinite; animation-direction: alternate; } </style> </head> <body> <div class="box"></div> </body> </html>