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