animation-direction

Introduction

animation-direction property specifies whether the animation should play in reverse.

Examples

Syntax

animation-direction: normal
animation-direction: reverse
animation-direction: alternate
animation-direction: alternate-reverse
animation-direction: normal, reverse
animation-direction: alternate, reverse, normal

Values

normal

The animation plays forward in each cycle. In other words, each animation cycle ends and resets to the starting point to begin again. This is the default behavior.

alternate

The animation alternates between running forwards and backwards. When running backwards, the animation steps backward and timing functions are also reversed. For example, ease-in becomes ease-out when reversed.

reverse

The animation runs backwards, playing from end to start.

alternate-reverse

The animation runs backwards on the first iteration, then forwards on the next, and continues alternating.

Formal definition

Initial valuenormal
Applies toall elements
Inheritedno
Animatableno

Formal syntax

/*default value: normal*/
animation-direction: normal | reverse | alternate | alternate-reverse;

See also

Compatibility

LCD tables only load in the browser

Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.