[英]min-height not working with multiple child divs
我有一个网站,我在这里使用height auto设置内容div的高度,最小高度100%以确保内容div始终拉伸页面的高度。
我的HTML看起来像这样
<html>
<body>
<div id="holder">
<div id="outercontent">
<div id="innercontent">
content goes here
</div>
</div>
</div>
</body>
</html>
和我的CSS规则如下
html,body {
height:100%;
color:white;
}
#holder {
background-color:transparent;
width:100%;
min-height:100%;
height:auto;
position:absolute;
z-index:1;
}
#outercontent {
min-height:100%;
height:auto;
width:940px;
margin-left:auto;
margin-right:auto;
background-color:transparent;
background-image:url(../images/bowsides.png);
background-repeat:no-repeat;
overflow:hidden;
}
#innercontent {
width:900px;
height:auto;
min-height:100%;
margin-left:auto;
margin-right:auto;
background-color:#ffefce;
overflow:hidden;
}
持有人div是一个绝对定位的DIV,我需要这样做,因为我有一个旋转的背景,它将每个背景图像放在一个单独的绝对定位的div上。 因此,使用z-index将这个div放在所有这些div的顶部。
外部内容比内部内容宽一点,这用于给我留出空间的边框图像(因为尚未广泛支持css3边框图像)
内部内容是我的主要内容
min-height 100%适用于holder div(即组的最外面的div),但不适用于任何浏览器中的outercontent或innercontent
为什么是这样?
您可以尝试使用deleveloper工具在IE中打开源代码吗,我想某些东西会覆盖高度,您将得到确切的图片,然后
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.