animation-direction

Defines whether an animation should play forwards, backwards, or alternate back and forth on every other cycle. Useful for creating smooth 'yo-yo' effects.

It is documented as part of the CSS Animations specification.

/* Usage Example */
.pulse {
  animation: pulse-scale 2s infinite;
  /* Makes the animation play forward then backward */
  animation-direction: alternate;
}

/* Global values */
animation-direction: inherit;
animation-direction: initial;
animation-direction: revert;
animation-direction: revert-layer;
animation-direction: unset;
Widely available Since 2015 96% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2015.

43+
16+
9+
12+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC