欢迎光临
我们一直在努力

css中的animation-iteration-count属性怎么用

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

  CSS3animation-iteration-count属性

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

  语法:

  animation-iteration-count:n|infinite;

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

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

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

  CSS3animation-iteration-count属性的使用示例

  设置动画循环3次

  <!DOCTYPEhtml>

  <html>

  <head>

  <style>

  div

  {

  width:100px;

  height:100px;

  background:red;

  position:relative;

  animation:mymove3s;

  animation-iteration-count:3;

  /*SafariandChrome*/

  -webkit-animation:mymove3s;

  -webkit-animation-iteration-count:3;

  }

  @keyframesmymove

  {

  from{top:0px;}

  to{top:200px;}

  }

  @-webkit-keyframesmymove/*SafariandChrome*/

  {

  from{top:0px;}

  to{top:200px;}

  }

  </style>

  </head>

  <body>

  <div></div>

  </body>

  </html>

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

赞(0)
【声明】:本博客不参与任何交易,也非中介,仅记录个人感兴趣的主机测评结果和优惠活动,内容均不作直接、间接、法定、约定的保证。访问本博客请务必遵守有关互联网的相关法律、规定与规则。一旦您访问本博客,即表示您已经知晓并接受了此声明通告。