我有一个 div 设置height:100%;
和定位使用position:absolute
它一切正常,但是当 div 的内容导致它离开页面并强制它滚动时,div 不会更新它的高度。
我做了一个 jsfiddle 来显示问题http://jsfiddle.net/jw8Qc/3/
我有一个 div 设置height:100%;
和定位使用position:absolute
它一切正常,但是当 div 的内容导致它离开页面并强制它滚动时,div 不会更新它的高度。
我做了一个 jsfiddle 来显示问题http://jsfiddle.net/jw8Qc/3/
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;
}
Try using min-height:100% instead of height:100%
. 滑出 { 位置:绝对;顶部:0;左:155px;宽度:375px;} .slide-cont { 背景:#000; 边距:20px;高度:自动;}