css animation-iteration-count属性怎么用


本文摘自PHP中文网,作者藏色散人,侵删。

css animation-iteration-count属性是用于定义动画播放次数的;设置animation-iteration-count属性的值为infinite,就可实现动画的无限循环播放。

css animation-iteration-count属性怎么用

作用:animation-iteration-count 属性定义动画的播放次数。

语法:

1

animation-iteration-count: n|infinite;

说明:n 定义动画播放次数的数值。infinite 规定动画应该无限次播放。

注释:Internet Explorer 9 以及更早的版本不支持 animation-iteration-count 属性。

css animation-iteration-count属性使用示例

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

<!DOCTYPE html>

<html>

<head>

<style>

div

{

width:100px;

height:100px;

background:red;

position:relative;

animation:mymove 3s;

animation-iteration-count:3;

/* Safari and Chrome */

-webkit-animation:mymove 3s;

-webkit-animation-iteration-count:3;

}

@keyframes mymove

{

from {top:0px;}

to {top:200px;}

}

@-webkit-keyframes mymove /* Safari and Chrome */

{

from {top:0px;}

to {top:200px;}

}

</style>

</head>

<body>

<p><strong>注释:</strong>Internet Explorer 9 以及更早的版本不支持 animation-iteration-count 属性。</p>

<div></div>

</body>

</html>

效果:

36caeadafb33b6029c7c1884e3ab1b2.png

以上就是css animation-iteration-count属性怎么用的详细内容,更多文章请关注木庄网络博客

相关阅读 >>

css如何让img垂直居中

css怎么使字体更加紧凑

css如何增加下划线

css如何去掉图片边框

css里的display属性有啥作用

css怎么给表格设置边框

css怎么把纵向排列变成横向

什么是css盒子模型?

css如何设置一行字显示不完隐藏

css怎么去掉属性

更多相关阅读请进入《css》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...