1

我有一个 div 设置height:100%;和定位使用position:absolute它一切正常,但是当 div 的内容导致它离开页面并强制它滚动时,div 不会更新它的高度。

我做了一个 jsfiddle 来显示问题http://jsfiddle.net/jw8Qc/3/

4

3 回答 3

1

Set your height property to auto or try to use min-height: auto and it should works.

Note: But with min-height property i'm not sure with its compatibility.


Also here is i think problem with min-height in IE especially in IE 9.

EDIT:

.slide-out {
   position:absolute; 
   top:0; 
   left:155px; 
   width:375px; 
}

.slide-cont {
   background:#000;
   margin:20px;
   height: auto;
}
于 2012-06-22T14:10:48.990 回答
0

Try using min-height:100% instead of height:100%

于 2012-06-22T14:10:17.367 回答
0

. 滑出 { 位置:绝对;顶部:0;左:155px;宽度:375px;} .slide-cont { 背景:#000; 边距:20px;高度:自动;}

于 2014-12-19T11:50:35.083 回答