[英]IE6 bug, CSS, position absolute and height 100% inner DIV
我在做网站,那里有3个DIV,
<div id="inner">
<div id="content" >
<div id="scroll" >
</div>
</div>
</div>
现在,div的“内部”是宽度和高度-自动,绝对位置; “内容”的宽度:100%; 高度:100%; 而“滚动”是宽度:96%; 填充:2%; 高度:96%; 溢出:自动;
html, body {width:100%; height:100%; margin:0; padding:0; border:0 none;}
#scroll
{
width: 96%;
padding:2%;
height: 96%;
overflow: auto;
}
#content {
width:100%;
height:100%;
overflow:hidden;
line-height:18px;
}
#inner {
position:absolute;
background:none;
width:auto;
height:auto;
top:40px;
bottom:85px;
right:10px;
left:300px;
}
在Firefox中,Opera IE8 <一切正常,但是在IE6和IE7中,div“滚动”太长,高度:100%不起作用。 您可以在图片上看到它 :
有人有主意吗? 请帮我 :)
IE7也有此错误。
我能找到的唯一解决方法是,将#content-element
也设置为position:absolute
。
我不确定,但是我认为也许对高度属性使用“继承”可以解决问题。
对于IE中100%的高度,您需要将此高度添加到CSS中。
* html #content{
height:100%;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.