头尾固定中间高度自适应布局

<!DOCTYPE HTML>
<html>
<head>
<meta charset="gb2312">
<title>头尾固定中间高度自适应布局</title>
<style>
html, body {
height:100%;
margin:0;
padding:0
}
#dHead {
height:100px;
line-height:100px;
background:#690;
width:100%;
position:absolute;
z-index:5;
top:0;
text-align:center;
}
#dBody {
background:#FC0;
width:100%;
overflow:auto;
top:100px;
position:absolute;
z-index:10;
bottom:100px;
}
.mycontent {
padding:20px;
}
#dFoot {
height:100px;
background:#690;
width:100%;
position:absolute;
z-index:200;
bottom:0;
}
</style>
</head>

<body>
<div id="dHead">固定头部100px;</div>
<div id="dBody">
<div class="mycontent"> 中间自适应部分</div>
</div>
<div id="dFoot"></div>
</body>
</html>

posted on 2015-07-09 11:33  股舞人心  阅读(277)  评论(0编辑  收藏  举报