案例:CSS3 案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<style> 
5
div
6
{
7
width:100px;
8
height:100px;
9
background:blue;
10
transition-property:width;
11
transition-duration:5s;
12
transition-delay:2s;
13
14
/* Firefox 4 */
15
-moz-transition-property:width; 
16
-moz-transition-duration:5s;
17
-moz-transition-delay:2s;
18
19
/* Safari and Chrome */
20
-webkit-transition-property:width; 
21
-webkit-transition-duration:5s;
22
-webkit-transition-delay:2s;
23
24
/* Opera */
25
-o-transition-property:width;
26
-o-transition-duration:5s;
27
-o-transition-delay:2s;
28
}
29
30
div:hover
31
{
32
width:300px;
33
}
34
</style>
35
</head>
36
<body>
37
38
<div></div>
39
40
<p>请把鼠标指针移动到蓝色的 div 元素上,就可以看到过渡效果。</p>
41
42
<p><b>注释:</b>过渡效果会在开始前等待两秒钟。</p>
43
44
<p><b>注释:</b>本例在 Internet Explorer 中无效。</p>
45
46
</body>
47
</html>
48