

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Set the number of times an animation should be played using CSS
Use the animation-iteration-count property to set the number of times an animation should be played with CSS
Example
<!DOCTYPE html> <html> <head> <style> div { width: 150px; height: 200px; position: relative; background-color: yellow; animation-name: myanim; animation-duration: 2s; animation-direction: alternate-reverse; animation-iteration-count: 3; } @keyframes myanim { from {left: 100px;} to {left: 200px;} } #demo1 {animation-timing-function: ease;} #demo2 {animation-timing-function: ease-in;} </style> </head> <body> <div id = "demo1">ease effect</div> <div id = "demo2">ease-in effect</div> </body> </html>
- Related Questions & Answers
- Set whether an animation should be played forwards or using CSS
- Set how many times an Animation should run with CSS
- Set how long an animation should take to complete one cycle using CSS
- Set the name of the CSS @keyframes animation
- Set a delay for the start of an animation with CSS
- How to specify the number of columns an element should be divided into with CSS
- Set an animation with a slow start and end using CSS
- Which CSS property is to be used to set the speed curve of the Animation?
- Set animation with a slow start using CSS
- Set animation with a slow end using CSS
- Set whether the animation is running or paused using CSS
- How to set or return the number of columns an element should be divided into with JavaScript?
- How to set the fill-mode for an Animation with CSS
- Set whether the text should be overridden to support multiple languages with CSS
- Which Measurement Unit should be used in CSS to set letter spacing
Advertisements