编辑您的代码:提交代码

x
 
1
 
2
 
3
<!DOCTYPE html>
4
<html>
5
<head>
6
<style> 
7
div
8
{
9
width:100px;
10
height:100px;
11
background:yellow;
12
transition:width 2s;
13
-moz-transition:width 2s; /* Firefox 4 */
14
-webkit-transition:width 2s; /* Safari and Chrome */
15
-o-transition:width 2s; /* Opera */
16
}
17
18
div:hover
19
{
20
width:300px;
21
}
22
</style>
23
</head>
24
<body>
25
26
<div></div>
27
28
<p>请把鼠标指针放到黄色的 div 元素上,来查看过渡效果。</p>
29
30
<p><b>注释:</b>本例在 Internet Explorer 中无效。</p>
31
32
</body>
33
</html>
34
            

查看结果:

请在上面的文本框中编辑您的代码,然后单击提交按钮测试结果。w3c0.com

W3c0.com 提供的内容仅用于培训。我们不保证内容的正确性。通过使用本站内容随之而来的风险与本站无关。W3c0 简体中文版的所有内容仅供测试,对任何法律问题及风险不承担任何责任。 当使用本站时,代表您已接受了本站的使用条款和隐私条款。版权所有,保留一切权利。 鲁ICP备15022115号