css3动画不循环怎么办
程序员文章站
2022-04-04 12:03:52
...
css3动画不循环可以使用animation-iteration-count属性定义动画的播放次数。只需要在动画中添加“animation-iteration-count:infinite;”即可实现无限次循环。
本教程操作环境:windows7系统、CSS3&&HTML5版、Dell G3电脑。
animation-iteration-count 属性定义动画的播放次数。
语法
animation-iteration-count: n|infinite;
实例
<!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>
效果:
推荐学习:css视频教程
以上就是css3动画不循环怎么办的详细内容,更多请关注其它相关文章!
上一篇: css3跟css区别是什么
下一篇: php max函数的使用方法
推荐阅读
-
flash怎么设置动画部不循环播放?
-
flash怎么设置动画部不循环播放?
-
分享一个CSS3圆圈放大缩小循环动画的效果代码
-
css3实现循环执行动画,且动画每次都有延迟 - starof
-
写多个物件css3循环动画案例原理_html/css_WEB-ITnose
-
css3实现循环执行动画,且动画每次都有延迟 - starof
-
css3实现循环执行动画,且动画每次都有延迟_html/css_WEB-ITnose
-
写多个物件css3循环动画案例原理_html/css_WEB-ITnose
-
50年前端开发写CSS3炫酷动画(不炫酷来打我)
-
css3实现循环执行动画,且动画每次都有延迟_html/css_WEB-ITnose