animation-fill-mode
Introduction
animation-fill-mode property sets how a CSS animation applies styles to its target before and after its execution.
Examples

Syntax
Values
none
Default value. The animation will not apply any styles to the target when it's not executing. The element will display using the CSS rules that have already been applied to it. This is the default value.
forwards
The target will retain the computed values set by the last keyframe encountered during execution. The last keyframe depends on the values of animation-direction and animation-iteration-count:
backwards
The animation will apply the values defined in the first keyframe at the start of the animation. The first keyframe depends on the value of animation-direction:
both
The animation will follow both the forwards and backwards rules, applying the keyframe values both before and after the animation.
Formal definition
| Initial value | none |
| Applies to | all elements |
| Inherited | no |
| Animatable | no |
Formal syntax
See also
- animation
- animation-name
- animation-duration
- animation-timing-function
- animation-delay
- animation-iteration-count
- animation-direction
- animation-fill-mode
- animation-play-state
- CSS animation event
- Animated API
Compatibility
LCD tables only load in the browser