#header{
position:absolute;
top:0;
width:100%;
height:100px;
background:#ccc;
line-height:100px;
text-align:center;
}
#middle{
position: absolute!important;
position: relative;
top:100px!important;
top:0;
bottom:100px;
width:100%;
height:auto!important;
height:100%;
background:#ffc;
text-align:center;
overflow: auto;
}
#footer{
position:absolute;
bottom:0;
width:100%;
height:100px;
background:#ccc;
line-height:100px;
text-align:center;
}
找了好久,才找到。
position:absolute;
top:0;
width:100%;
height:100px;
background:#ccc;
line-height:100px;
text-align:center;
}
#middle{
position: absolute!important;
position: relative;
top:100px!important;
top:0;
bottom:100px;
width:100%;
height:auto!important;
height:100%;
background:#ffc;
text-align:center;
overflow: auto;
}
#footer{
position:absolute;
bottom:0;
width:100%;
height:100px;
background:#ccc;
line-height:100px;
text-align:center;
}
找了好久,才找到。
本文提供了一段关于网页布局样式的CSS代码,详细展示了如何通过绝对定位实现头部、中部及底部的固定布局。此布局适用于创建稳定的网站结构。
1264

被折叠的 条评论
为什么被折叠?



