实例代码“Ctrl+/”提示“F11/ESC”全屏 返回 格式化 恢复 运行
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<style> 
5
div
6
{
7
width:100px;
8
height:100px;
9
background:red;
10
position:relative;
11
animation:mymove 5s infinite;
12
-webkit-animation:mymove 5s infinite; /*Safari and Chrome*/
13
}
14
15
@keyframes mymove
16
{
17
from {left:0px;}
18
to {left:200px;}
19
}
20
21
@-webkit-keyframes mymove /*Safari and Chrome*/
22
{
23
from {left:0px;}
24
to {left:200px;}
25
}
26
</style>
27
</head>
28
<body>
29
30
<p><strong>注意: </strong> Internet Explorer 9 及更早IE版本不支持动画属性。</p>
31
32
<div></div>
33
34
</body>
35
</html>
36