Home >Web Front-end >CSS Tutorial >css3 which is to set the number of animation playback times

css3 which is to set the number of animation playback times

醉折花枝作酒筹
醉折花枝作酒筹Original
2021-07-14 15:10:583542browse

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.

css3 which is to set the number of animation playback times

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn