CSS3 animation-iteration-count Property

Example

Play the animation two times:

div {
animation-iteration-count: 2;
}

Try it Yourself »

More “Try it Yourself” examples below.

Definition and Usage

The animation-iteration-count property specifies the number of times an animation should be played.

Default value: 1
Inherited: no
Animatable: no. Read about animatable
Version: CSS3
JavaScript syntax: object.style.animationIterationCount=”infinite” Try it
CSS Syntax
animation-iteration-count: number|infinite|initial|inherit;
Property Values
Value Description Code
number A number that defines how many times an animation should be played. Default value is 1 #myDIV {
animation-iteration-count:2;
}
infinite Specifies that the animation should be played infinite times (for ever) #myDIV {
animation-iteration-count:infinite;
}
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit
Example

Play the animation forever:

div {
animation-iteration-count: infinite;
}

Try it Yourself »

Post Author: Zahid Farid