【CSS3教程】之animation的animation-iteration-count属性
设置动画应运行多少次
animation-iteration-count 属性指定动画应运行的次数。
下面的例子在停止前把动画运行 3 次:
实例
div {
width: 100px;
height: 100px;
position: relative;
background-color: red;
animation-name: example;
animation-duration: 4s;
animation-iteration-count: 3;
}
下面的例子使用值 "infinite" 使动画永远持续下去:
实例
div {
width: 100px;
height: 100px;
position: relative;
background-color: red;
animation-name: example;
animation-duration: 4s;
animation-iteration-count: infinite;
}