In CSS, you can use the animation-iteration-count attribute to set the number of animation playback times. You only need to set the "animation-iteration-count: infinite" style to the element.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
The animation-iteration-count attribute is mainly used to define the number of times the animation is played.
Grammar rules:
animation-iteration-count: infinite | [, infinite | ]*
1. Its value is usually an integer, but you can also use numbers with decimals. Its default value is 1, which means that the animation will only Play it once.
2. If the value is infinite, the animation will play infinitely.
Example:
Use the animation-iteration-count attribute to play the animation move only 5 times. The code is set to:
animation-iteration-count:5;
Note: For Chrome or Safari browsers, you need to add the -webkit- prefix!
Recommended learning: css video tutorial
The above is the detailed content of css3 which is to set the number of animation playback times. For more information, please follow other related articles on the PHP Chinese website!