CSS animation-fill-mode Property
Example
div {
animation-fill-mode: forwards;
}
Meaning
The animation-fill-mode CSS property sets how a CSS animation applies styles to its target before and after its execution.
Default value: | none |
Inherited: | No |
Animatable: | No |
Version: | CSS3 |
JavaScript syntax: |
|
Standard Syntax
animation-fill-mode: none|forwards|backwards|both|initial|inherit|revert|revert-layer|unset;
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
Status
Property Values
The following table describes the values of this property:
Value | Description |
---|---|
none | The animation will not apply any styles to the target before or after it is executing. |
forwards | After the animation ends the animation will apply the property values for the time the animation ended. |
backwards | The animation will apply the property values defined in the keyframe that will start the first iteration of the animation, during the period defined by animation-delay property. |
both | The animation will follow the rules for both forwards and backwards, thus extending the animation properties in both directions. |
initial | Sets this property to its default value. |
inherit | If specified, the associated element takes the computed value of its parent element animation-delay property. |
revert | Reverts the cascaded value of the property from its current value to the value the property |
revert-layer | Rollback styles to the ones specified in previous cascade layers. |
unset | Resets a property to its inherited value if the property naturally inherits from its parent, and to its initial value if not. |
Default CSS Property Values
selectors {
animation-fill-mode: none;
}