coderef

Animations (CSS)Baseline · Widely available

The animation CSS property animates an element's style over time, using keyframes described in @keyframes rules.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Sep 30, 2015. Widely available since Mar 30, 2018.

Browser support

DesktopChrome
1–42Not supported
43+Supportedsince May 19, 2015
Current: 155
Edge
12+Supportedsince Jul 29, 2015
Current: 154
Firefox
1–15Not supported
16+Supportedsince Oct 9, 2012
Current: 157
Safari
1–8Not supported
9+Supportedsince Sep 30, 2015
Current: 27
MobileChrome Android
18–42Not supported
43+Supportedsince May 27, 2015
Current: 155
Firefox Android
4–15Not supported
16+Supportedsince Oct 9, 2012
Current: 157
Safari iOS
1–8Not supported
9+Supportedsince Sep 16, 2015
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: AnimationEvent.

Feature detection

CSS · check before using
@supports (animation: initial) {
  /* styles that rely on animation */
}

/* or in JavaScript */
if (CSS.supports("animation", "initial")) {
  // use it
}

Sub-features

Support for each part of the feature (68). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
AnimationEvent4312594359
AnimationEvent.AnimationEvent431423943239
AnimationEvent.animationName4312594359
AnimationEvent.elapsedTime4312594359
AnimationEvent.pseudoElement68792313.1682313.4
CSSAnimation84847513.1847913.4
CSSAnimation.animationName84847513.1847913.4
CSSKeyframeRule311248931489
CSSKeyframeRule.keyText311248931489
CSSKeyframeRule.style311248931489
CSSKeyframesRule3112489.131489.3
CSSKeyframesRule.appendRule4112489.141489.3
CSSKeyframesRule.cssRules3112489.131489.3
CSSKeyframesRule.deleteRule3112489.131489.3
CSSKeyframesRule.findRule3112489.131489.3
CSSKeyframesRule.length1231231091712310917
CSSKeyframesRule.name3112489.131489.3
@keyframes431216943169
@keyframes.ignore_important_declarations45791910.1451910.3
@keyframes.named_range_keyframes115115✕26115✕26
Show 48 more
Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
animation431216943169
animation-delay431216943169
animation-direction431216943169
animation-direction.alternate431216943169
animation-direction.alternate-reverse431216943169
animation-direction.normal431216943169
animation-direction.reverse431216943169
animation-duration431216943169
animation-duration.auto115115✕18.4115✕18.4
animation-fill-mode431216943169
animation-fill-mode.backwards431216943169
animation-fill-mode.both431216943169
animation-fill-mode.forwards431216943169
animation-fill-mode.none431216943169
animation-iteration-count431216943169
animation-iteration-count.infinite431216943169
animation-name431216943169
animation-name.none431216943169
animation-play-state431216943169
animation-play-state.paused431216943169
animation-play-state.running431216943169
animation-timing-function431216943169
animation-timing-function.ease431216943169
animation-timing-function.ease-in431216943169
animation-timing-function.ease-in-out431216943169
animation-timing-function.ease-out431216943169
animation-timing-function.jump77796514776514
animation-timing-function.linear431216943169
animation-timing-function.step-end431216943169
animation-timing-function.step-start431216943169
animation.alternate431216943169
animation.alternate-reverse431216943169
animation.auto431216943169
animation.backwards431216943169
animation.both431216943169
animation.ease431216943169
animation.ease-in431216943169
animation.ease-in-out431216943169
animation.ease-out431216943169
animation.forwards431216943169
animation.infinite431216943169
animation.linear431216943169
animation.none431216943169
animation.normal431216943169
animation.reverse431216943169
animation.step-end431216943169
animation.step-start431216943169
<time>11243.11842