animation-delay属性怎么用


本文摘自PHP中文网,作者青灯夜游,侵删。

animation-delay属性是用来定义动画何时开始,以秒或毫秒为单位;使用animation-delay属性可以自定义动画的延迟效果。

CSS3 animation-delay属性

作用:animation-delay 属性定义动画何时开始。animation-delay 值以秒或毫秒计。

语法:

1

animation-delay: time;

time:可省略,默认值是 0;用来定义动画开始前等待的时间,以秒或毫秒计。

说明:time允许为负值,-2s使动画马上开始,但跳过 2 秒进入动画。

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

CSS3 animation-delay属性的使用示例

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

<!DOCTYPE html>

<html>

<head>

<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>

 

<div></div>

 

</body>

</html>

效果图:

1.gif

以上就是本篇文章的全部内容,希望能对大家的学习有所帮助。更多精彩内容大家可以关注php中文网相关教程栏目!!!

以上就是animation-delay属性怎么用的详细内容,更多文章请关注木庄网络博客

相关阅读 >>

css3新增伪类有哪些

使用css过渡有哪些触发方式

qq浏览器 不支持css3怎么办

css3中怎么调节透明度

css3新特性有哪些

什么是css3

运用css3动画需要运用什么规则

css3支持为网页添加多个背景图片吗

css3有哪些新特性?css3新特性详解

聊聊你可能不了解的css属性函数 attr()

更多相关阅读请进入《animation-delay属性》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...

    正在狠努力加载,请稍候...