The animation-fill-mode property defines what values are applied by the animation outside the time it is executing. By default, an animation will not affect property values between the time it is applied (the animation-name property is set on an element) and the time it begins execution (which is determined by the animation-delay property). Also, by default an animation does not affect property values after the animation ends (determined by the animation-duration property). The animation-fill-mode property can override this behavior.

  • Initial valuenone
  • Applies toAll elements, :before and :after pseudo elements
  • InheritedNo
  • MediaVisual
  • Computed valueAs specified
  • AnimatableNo
  • CSS VersionCSS3
  • JavaScript syntaxobject.style.animationFillMode
Formal syntax: <single-animation-fill-mode> [ ',' <single-animation-fill-mode> ]* 

animation-fill-mode: none;
animation-fill-mode: forwards;
animation-fill-mode: backwards;
animation-fill-mode: both;
<single-animation-fill-mode> = none | forwards | backwards | both
  • noneThe animation will not apply any styles to the target before or after it is executing.
  • forwardsThe target will retain the computed values set by the last keyframe encountered during execution.
  • backwardsThe animation will apply the values defined in the first relevant keyframe as soon as it is applied to the target, and retain this during the animation-delay period.
  • bothThe animation will follow the rules for both forwards and backwards, thus extending the animation properties in both directions.
.class {
   animation-fill-mode: forwards;
}
?Firefox?Explorer?Chrome?Safari?Opera


Last updated on 23rd March 2014 By Rene Spronk

View All CSS Properties

Errors? Please help to keep this list up to date, If you find any errors, please contact us, so that we can get them fixed.