案例: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:width 2s;
11
-moz-transition:width 2s; /* Firefox 4 */
12
-webkit-transition:width 2s; /* Safari and Chrome */
13
-o-transition:width 2s; /* Opera */
14
}
15
16
div:hover
17
{
18
width:300px;
19
}
20
</style>
21
</head>
22
<body>
23
24
<div></div>
25
26
<p>请把鼠标指针移动到蓝色的 div 元素上,就可以看到过渡效果。</p>
27
28
<p><b>注释:</b>本例在 Internet Explorer 中无效。</p>
29
30
</body>
31
</html>
32