- HTML中文网
- 联系QQ:88526
- QQ交流群

- 微信公众号

animation-iteration-count属性
含义:
animation-iteration-count属性定义动画应该播放多少次
浏览器支持:
属性 | ![]() | ![]() | ![]() | ![]() | ![]() |
浏览器 | IE | Chrome | Firefox | Safari | Opera |
animation-iteration-count | 10.0 | 43.0 4.0 -webkit- | 16.0 5.0 -moz- | 9.0 4.0 -webkit- | 30.0 15.0 -webkit- 12.0 -o- |
CSS语法:
animation-iteration-count: value;
属性值:
n:设置一个数字来定义应该播放多少次动画
infinite :指定动画播放无限次
设置动画播放无数次
<style type="text/css"> div{ width:100px; height:100px; position: relative; background-color:hsl(120,65%,75%); animation:demo 5s; animation-iteration-count:infinite; -webkit-animation-iteration-count:infinite; /* Safari 和 Chrome */ } @keyframes demo { from {left:0px;} to {left:350px; opacity: 0.5;} } /*Safari 和 Chrome */ @-webkit-keyframes demo { from {left:0px;} to {left:350px; opacity: 0.5;} } </style> </head> <body> <div></div> </body>
点击 "运行实例" 按钮查看在线实例
效果图
推荐手册