当前阅读教程:CSS3教程 > animation-delay 属性 | |||||||||||||
阅读(22555525) 收藏 赞(5685) 分享 | |||||||||||||
上一篇: animation-fill-mode 属性 | 下一篇: animation-iteration-count 属性 | ||||||||||||
浏览器支持表格中的数字表示支持该属性的第一个浏览器版本号。 紧跟在 -webkit-, -ms- 或 -moz- 前的数字为支持该前缀属性的第一个浏览器版本号。 标签定义及使用说明animation-delay 属性定义动画什么时候开始。 animation-delay 值单位可以是秒(s)或毫秒(ms)。 提示: 允许负值,-2s 使动画马上开始,但跳过 2 秒进入动画。
语法animation-delay: time;
实例等待两秒,然后开始动画 代码<!doctype html> <html> <head> <meta charset="utf-8"> <title>animation-delay 属性</title> <!--定义内部样式--> <style> div { width:100px; height:100px; background:red; position:relative; animation:mymove 5s infinite; animation-delay:2s;/*等待两秒,然后开始动画*/ /*Safari and Chrome*/ -webkit-animation:mymove 5s infinite; -webkit-animation-delay:2s; } @keyframes mymove { from {left:0px;} to {left:200px;} } @-webkit-keyframes mymove /*Safari and Chrome*/ { from {left:0px;} to {left:200px;} } </style> </head> <body> <p><strong>注意:</strong> animation-delay 属性不兼容Internet Explorer 9 以及更早版本的浏览器</p> <div></div> </body> </html> |
|||||||||||||
上一篇: animation-fill-mode 属性 | 下一篇: animation-iteration-count 属性 |