CSS animation Property
CSS animation Property
CSS animation
property applies an animation between styles. It is a shorthand property of the following CSS properties
- animation-name
- animation-duration
- animation-timing-function
- animation-delay
- animation-iteration-count
- animation-direction
- animation-fill-mode
- animation-play-state
Example
Syntax
Using CSS
Using Javascript
Animatable
No, animation property is not animatable. CSS Animatable Properties Reference.
Default Value
Default value for CSS animation property is none 0s ease 0s 1 normal none running.
Property Value
The following table provides a list of values for CSS animation
property.
Value | Type | Explanation |
---|---|---|
animation-name | Required | Specifies the name identifying the animation. |
animation-duration | Required | Specifies the duration that an animation takes to complete one cycle. |
animation-timing-function | Optional | Specifies the speed curve of the animation. |
animation-delay | Optional | Specifies the time delay at which the animation should begin. |
animation-iteration-count | Optional | Specifies how many times an animation should be played. |
animation-direction | Optional | Specifies that whether an animation should play forwards, backwards, or alternating back and forth. |
animation-fill-mode | Optional | Specifies how a CSS animation applies styles to its target before and after its execution. |
animation-play-state | Optional | Specifies whether an animation is running or paused. |
Using JavaScript
In the following example, we will demonstrate how to set the CSS animation
property of an element using JavaScript.
Example
Reminder
Hi Developers, we almost covered 98.7% of CSS Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in CSS.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.