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

- 微信公众号

animation-duration属性
含义:
animation-duration属性用于定义动画完成一个周期需要多少秒或毫秒
浏览器支持:
属性 | ![]() | ![]() | ![]() | ![]() | ![]() |
浏览器 | IE | Chrome | Firefox | Safari | Opera |
animation-duration | 10.0 | 43.0/3.0 -webkit- | 16.0/5.0 -moz- | 9.0/4.0 -webkit- | 30.0 15.0 -webkit- 12.0 -o- |
CSS语法:
animation-duration: time;
属性值:
time:指定动画播放完成花费的时间。默认值为 0,意味着没有动画效果
<style type="text/css"> div{ width:100px; height:100px; position: relative; background-color:hsl(120,65%,75%); animation:demo infinite ; -webkit-animation:demo infinite; animation-duration:5s; -webkit-animation-duration:5s; } @keyframes demo { from {left:0px;} to {left:450px;} } /*Safari 和 Chrome */ @-webkit-keyframes demo { from {left:0px;} to {left:450px;} } </style> </head> <body> <div></div> </body> </html>
点击 "运行实例" 按钮查看在线实例
效果图:
推荐手册