编辑您的代码:提交代码

x
 
1
 
2
 
3
<!DOCTYPE html>
4
<html>
5
<head>
6
<style> 
7
div
8
{
9
width:100px;
10
height:100px;
11
background:red;
12
position:relative;
13
animation-name:mymove;
14
animation-duration:5s;
15
16
/* Safari and Chrome */
17
-webkit-animation-name:mymove;
18
-webkit-animation-duration:5s;
19
}
20
21
@keyframes mymove
22
{
23
from {left:0px;}
24
to {left:200px;}
25
}
26
27
@-webkit-keyframes mymove /* Safari and Chrome */
28
{
29
from {left:0px;}
30
to {left:200px;}
31
}
32
</style>
33
</head>
34
<body>
35
36
<p><strong>注释:</strong>Internet Explorer 9 以及更早的版本不支持 animation-name 属性。</p>
37
38
<div></div>
39
40
<p><b>注释:</b>始终规定 animation-duration 属性,否则时长为 0,就不会播放动画了。</p>
41
42
</body>
43
</html>
44
            

查看结果:

请在上面的文本框中编辑您的代码,然后单击提交按钮测试结果。w3c0.com

W3c0.com 提供的内容仅用于培训。我们不保证内容的正确性。通过使用本站内容随之而来的风险与本站无关。W3c0 简体中文版的所有内容仅供测试,对任何法律问题及风险不承担任何责任。 当使用本站时,代表您已接受了本站的使用条款和隐私条款。版权所有,保留一切权利。 鲁ICP备15022115号