1、说明,center使用了position绝对位置,如果顶部top和底部bottom绝对位置不恰当,会覆盖掉#header和#footer
#middle{
position: absolute!important;
position: relative;
top:120px!important;
top:0;
bottom:100px;
width:100%;
height:auto!important;
height:100%;
// background:#ffc;
text-align:center;
overflow: auto;
}
#header{
position:absolute;
top:0;
width:100%;
//height:100px;
// background:#ccc;
line-height:100px;
text-align: left;
}
#footer{
position:absolute;
bottom:0;
width:100%;
height:auto;
// background:#ccc;
text-align: left;
}
2、使用
<HTML>
<div id="header"></div>
<div id="middle"></div>
<div id="footer"></div>
</HTML>