asp.net.ph

Skip Navigation LinksAbakada: Back to Basics > Language References > CSS Properties > Animation Properties > animation-direction Property

animation-direction | animationDirection Property


Sets or retrieves the playback direction of the associated animation effect.

Syntax

CSS { animation-direction: normal | reverse | alternate | alternate-reverse }
Script object.style.animationDirection = normal | reverse | alternate | alternate-reverse

Possible Values

Parameter Description Valid Values
normal All iterations of the animation are played as specified. the keyword normal.
reverse All iterations of the animation are played in the reverse direction from the way they were specified. the keyword reverse.
alternate Even iterations are played in the reverse direction, odd iterations are played normal. the keyword alternate.
alternate-reverse Even iterations are played in the normal direction, odd iterations are played in reverse. the keyword alternate-reverse.

The property is read/write with a default value of normal; the CSS attribute is not inherited.

Remarks

The animation-direction property defines whether an animation should play forward, backward, or alternate back and forth between playing the sequence forward and backward.

animation-direction is specified with any of the possible values above.

A value of normal means the animation plays forwards each cycle.

A value of reverse means the animation plays backwards each cycle.

A value of alternate means the animation reverses direction each cycle, with the first iteration being played forwards.

A value of alternate-reverse means the animation reverses direction each cycle, with the first iteration being played backwards.

Any other value invalidates the CSS declaration.

NOTE: While the separate animation properties can be set individually, the shorthand animation property offers a convenient option to set all animation properties at once.

Example

The following basic animation examples demonstrate use of the animation-direction property.

Basic Animation: Normal and Reverse Playback
Run Sample | View Source
Basic Animation: Slide and Resize
Run Sample | View Source

For a brief overview, please see Understanding and Using CSS Animations.

See Also

animation, animation-composition, animation-delay, animation-duration, animation-fill-mode, animation-iteration-count, animation-name, animation-play-state, animation-timeline, animation-timing-function


Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph.

If you have any question, comment or suggestion,
please send us a note