【发布时间】:2015-04-28 07:24:50
【问题描述】:
我使用了四个DIVs:容器、页眉、内容和页脚。
基于文本或图像,内容 DIV 已展开,但页眉和页脚 div 在 IE7、IE8 和 IE9 中不展开,但在 Firefox、IE10 和 IE11 中可以正常工作。
HTML:
<div id="container">
<div id="header"></div>
<div id="content"></div>
<div id="footer"></div>
</div>
CSS
<style>
body {
height:100%;
margin-left: 0;
margin-top: 0;
padding:0;
width:100%;
position: relative;
display:inline-block;
}
#header {
top:0px;
height:75px;
width:100%;
}
#container {
display:table;
width:100%;
height:100%;
}
#content {
width:100%;
height:auto;
}
#footer {
top:5px;
bottom:0px;
height:45px;
width:100%;
}
</style>
有什么想法吗?
【问题讨论】:
-
他需要纵向扩展还是横向扩展?因为页脚和页眉的高度固定为 45pc 和 75px。
-
我需要横向展开
-
我不明白为什么它不工作,因为宽度是
100%所以它应该工作 -
@Vinc199789..我不知道为什么内容div展开时页眉和页脚宽度没有扩大。