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