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.
Syntax
/* 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;
animation-direction Browser support
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+