CSS animation fill mode Property
CSS animation-fill-mode Property
The animation-fill-mode property is used to specify a style for the element when the animation is not playing i.e, before animation starts, after the animation ends, or both.
Default Value:-
Its default value is none.
Syntax:-
Its syntax is:- animation-fill-mode: none | forwards | backwards | both | initial | inherit;
Further Explanation:-
Value | Description |
---|---|
none | Default value. The animation will not apply any styles to the element. |
forwards | The element will retain the style values that are set by the last keyframe. |
backwards | The element will get the style values that are set by the first keyframe and retain this during the animation-delay period |
both | The animation will follow the rules for both forwards and backwards.This will extend animation properties in both directions |
initial | Sets this property to its default value. |
inherit | Inherits this property from its parent element. |