案例: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>

 运行结果 
 北美留学生论坛