level 12
破灭梦
楼主
主要是当高那里不用px用100%的时候
不会有效果?
那有没有能有效果的写法?
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 100px;
height: 100px;
background: red;
-webkit-transition: width 2s; /* For Safari 3.1 to 6.0 */
transition:height 2s;
overflow:auto;
}
div:hover {
height: 100%;
width:100%
}
</style>
</head>
<body>
<p><b>Note:</b> This example does not work in Internet Explorer 9 and earlier versions.</p>
<div>1
1<br>
1111111111111111111111111111111111111111111111111111111111111111111111111111<br>br>11111111111111111111111111111111111111111111111111111111111111111111111111111<br><br>111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111<br><br>111111111111
1111111111111111111111111<br><br>11111111111111111111111111111111111111111111111111<br>111111111<br>1111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1
1
1
1
1
1
1
1
1
1
1
1</div>
<p>Hover over the div element above, to see the transition effect.</p>
</body>
</html>
2014年07月28日 00点07分
1
不会有效果?
那有没有能有效果的写法?
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 100px;
height: 100px;
background: red;
-webkit-transition: width 2s; /* For Safari 3.1 to 6.0 */
transition:height 2s;
overflow:auto;
}
div:hover {
height: 100%;
width:100%
}
</style>
</head>
<body>
<p><b>Note:</b> This example does not work in Internet Explorer 9 and earlier versions.</p>
<div>1
1<br>
1111111111111111111111111111111111111111111111111111111111111111111111111111<br>br>11111111111111111111111111111111111111111111111111111111111111111111111111111<br><br>111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111<br><br>111111111111
1111111111111111111111111<br><br>11111111111111111111111111111111111111111111111111<br>111111111<br>1111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1
1
1
1
1
1
1
1
1
1
1
1</div>
<p>Hover over the div element above, to see the transition effect.</p>
</body>
</html>