案例:CSS3 案例     状态:可编辑再运行    进入竖版
 运行结果 
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 以及更早的版本不支持 animation 属性。</p>
31
32
<div></div>
33
34
</body>
35
</html>
36