animation-fill-mode
property sets how a CSS animation applies styles to its target before and after its execution.
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.
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:
animation-direction | animation-iteration-count | last keyframe encountered |
---|---|---|
normal | even or odd | 100% or to |
reverse | even or odd | 0% or from |
alternate | even | 0% or from |
alternate | odd | 100% or to |
alternate-reverse | even | 100% or to |
alternate-reverse | odd | 0% or from |
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:
animation-direction | first relevant keyframe |
---|---|
normal or alternate | 0% or from |
reverse or alternate-reverse | 100% or to |
The animation will follow both the forwards and backwards rules, applying the keyframe values both before and after the animation.
Initial value | none |
Applies to | all elements |
Inherited | no |
Animatable | no |
LCD tables only load in the browser