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

醉折花枝作酒筹
Release: 2023-01-07 11:43:23
Original
3532 people have browsed it

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 | ]*
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template