Web4College

CSS animation iteration count

CSS animation-iteration-count property defines number of cycles in an animation.

Preview Example
Try it

There are total 3 cycles or iterations in the above example.

Syntax

Example
Try it
<style>
div{
animation-iteration-count: 5;
}
</style>

In the above example, there are 5 number of cycles in an animation.

Value

There are two possible values of animation-iteration-count.

Animation-iteration-count = infinite | number

infinite

The animation cycles will repeat forever.

number

The number represents the total number of cycles in an animation.

The value of animation-iteration-count can not be negative. 0 value causes the animation to occur instantaneously. If the number is a fractional value, it represents a part of a cycle. For example, 4.5 means there will be four and half cycles.

Default value

The initial value of the animation-iteration-count is 1.

Applicable to

It is applicable to all of the elements including ::before and ::after pseudo elements.

Browser support

Browsers

googlesafariinternet exploreroperafirefox

content

✓

-webkit-

-ms-

-o-

-moz-

Use the above given prefixes with this property for the relevant browsers otherwise it'll not work for other browsers.