案例: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-name:mymove;
12
animation-duration:5s;
13
14
/* Safari and Chrome */
15
-webkit-animation-name:mymove;
16
-webkit-animation-duration:5s;
17
}
18
19
@keyframes mymove
20
{
21
from {left:0px;}
22
to {left:200px;}
23
}
24
25
@-webkit-keyframes mymove /* Safari and Chrome */
26
{
27
from {left:0px;}
28
to {left:200px;}
29
}
30
</style>
31
</head>
32
<body>
33
34
<p><strong>注释:</strong>Internet Explorer 9 以及更早的版本不支持 animation-name 属性。</p>
35
36
<div></div>
37
38
<p><b>注释:</b>始终规定 animation-duration 属性,否则时长为 0,就不会播放动画了。</p>
39
40
</body>
41
</html>
42