css中使用animation-iteration-count属性的方法

小编给大家分享一下css中使用animation-iteration-count属性的方法,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!

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

css中使用animation-iteration-count属性的方法

css animation-iteration-count属性怎么用?

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

语法:

animation-iteration-count: n|infinite;

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

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

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

<!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中使用animation-iteration-count属性的方法

以上是css中使用animation-iteration-count属性的方法的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注行业资讯频道!