animation-iteration-count属性怎么用

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

CSS3 animation-iteration-count属性

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

语法:

animation-iteration-count: n|infinite;

n:定义动画播放次数的数值。

infinite:规定动画应该无限次播放。

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

CSS3 animation-iteration-count属性的使用示例

设置动画循环3次

<!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>  <div></div>  </body> </html>

效果图:

以上就是本篇文章的全部内容,希望能对大家的学习有所帮助。更多精彩内容大家可以关注php中文网相关教程栏目!!!

以上就是animation-iteration-count属性怎么用的详细内容,更多内容请关注技术你好其它相关文章!

来源链接:
免责声明:
1.资讯内容不构成投资建议,投资者应独立决策并自行承担风险
2.本文版权归属原作所有,仅代表作者本人观点,不代表本站的观点或立场
标签: 动画
上一篇:php获取远程图片并下载保存到本地的方法分析 下一篇:animation-delay属性怎么用

相关资讯