CSS animation-iteration-count Property
Description
The animation-iteration-count property in CSS defines how many times an animation should play before stopping. By default, most animations execute once, but this property allows designers to repeat the animation multiple times or infinitely, creating a continuous visual effect. It is particularly useful for drawing attention to specific elements, providing subtle motion to interfaces, or enhancing user interactions without relying on JavaScript. When used thoughtfully, it can contribute to a more dynamic and engaging user experience, making static elements feel lively or responsive.
This property is closely tied to animation as it determines the repetition of the keyframes defined in the @keyframes rule. For example, an element could fade in and out twice or bounce endlessly, depending on the count specified. It is also commonly paired with animation-direction, which controls whether the animation alternates directions on each iteration, enabling a back-and-forth effect rather than a simple restart. Without the iteration count set, an animation may complete just once, potentially missing the intended impact of motion in the design.
Beyond simple repetition, the animation-iteration-count property plays a critical role in timing and synchronization. When multiple animations are applied to the same element, coordinating the number of iterations ensures that transitions feel smooth and intentional. For instance, combining it with animation-delay can create cascading effects or staggered sequences, where one animation starts after another completes a specified number of iterations. Proper use of this property allows designers to create complex, visually appealing animations while maintaining control over how long and how often each effect occurs, resulting in polished, professional user interfaces.
Definition
- Initial value
- 1
- Applies to
- All elements, :before and :after pseudo elements
- Inherited
- No
- Computed value
- As specified
- Animatable
- No
- JavaScript syntax
- object.style.animationIterationCount
Interactive Demo
Syntax
animation-iteration-count: <single-animation-iteration-count> [ ',&' <single-animation-iteration-count> ]*
Values
- infiniteThe animation will repeat forever.
- <number>The number of times the animation should repeat; this is 1 by default. Negative values are invalid. You may specify non-integer values to play part of an animation cycle (for example 0.5 will play half of the animation cycle).
Example
Browser Support
The following information will show you the current browser support for the CSS animation-iteration-count property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
