css3动画不循环怎么办

发布时间:2022-05-17 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了css3动画不循环怎么办脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

css3动画不循环可以使用animation-iteration-count属性定义动画的播放次数。只需要在动画中添加“animation-iteration-count:infinite;”即可实现无限次循环。

css3动画不循环怎么办

本教程操作环境:windows7系统、CSS3&&HTML5版、Dell G3电脑。

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

语法

animation-iteration-count: n|infinite;

css3动画不循环怎么办

实例

<!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>

效果:

css3动画不循环怎么办

推荐学习:css视频教程

以上就是css3动画不循环怎么办的详细内容,更多请关注脚本宝典其它相关文章!

脚本宝典总结

以上是脚本宝典为你收集整理的css3动画不循环怎么办全部内容,希望文章能够帮你解决css3动画不循环怎么办所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: