Contact Us | +1 888 239-0733 (Toll free US/CA) Mon-Fri: 7:30am to 4:30pm (PST)

CSS 'animation-direction' Property Explained

Est. Reading: 1 minute
Updated: April 4, 2024

The CSS 'animation-direction' property specifies whether an animation should play forwards, backward, or alternate between playing forwards and backward. This property enhances the control over animation sequences, allowing for more complex and dynamic visual effects. It's particularly useful for creating looping animations that need to reverse at certain points or achieve a specific storytelling effect through animation.

CSS 'animation-direction' Property Examples

See the Pen CSS 'animation-direction' Property by Webzstore (@webzstore) on CodePen.

The 'animation-direction' property offers a straightforward way to modify the play direction of CSS animations, making it possible to craft more nuanced and engaging visual experiences on the web.

Browser Support For 'animation-direction' Property

FirefoxSafariChromeMicrosoft EdgeOpera
16.0
5.0 -moz-
9.0
4.0 -webkit-
43.0
4.0 -webkit-
10.030.0
15.0 -webkit-
12.0 -o-

CSS Syntax of the 'animation-direction' Property

animation-direction: normal|reverse|alternate|alternate-reverse;

Usage of the 'animation-direction' Property

Use 'animation-direction' when you want to control the direction flow of an animation sequence. This could be to create a pendulum-like effect where an animation smoothly transitions back and forth or to reverse the direction of an animation for visual variety or emphasis.

Property Values of the 'animation-direction' Property

  • Normal: The animation plays forward each cycle, which is the default behavior. It starts from the beginning of each iteration.
  • Reverse: The animation plays backward each cycle. It starts from the end and moves towards the beginning.
  • Alternate: The animation direction alternates with each iteration. It plays forwards on the first play, reverses on the second, and alternates.
  • Alternate-reverse: This is similar to alternate, but it starts by playing in reverse. The first cycle plays from the end to the beginning, alternating direction with each subsequent iteration.

Ryan Parker

Ryan has been a standout in digital marketing since 2010. He's the go-to person for getting businesses noticed online, with over 300 projects under his belt—these range from helping local business owners to big online stores. As the Head of Digital Marketing at Webzstore Solutions, Ryan knows all the tricks to make companies shine on the internet. He's excellent at using the latest tech and smart strategies to get results. Ryan is all about making businesses grow and reach more people online.

chevron-down