您的位置:首页 > 其它

头部和尾部固定中间自适应的布局

2014-09-25 09:43 288 查看
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<title>Document</title>
</head>
<body>
<div class="con">
<div class="top"></div>
<div class="md">
ssssdfs
</div>
<div class="bottom"></div>
</div>

<style>
*{margin:0; padding:0;}
html,body,.con{height:100%;width:100%;height:100%;width:100%;}
div{position:absolute;}
.top,.bottom{width:100%;height:100px;z-index:5;}
.top{background:red;top:0;}
.bottom{background:black;bottom:0;}
.md{
width:100%;
background:#a7fad7;
overflow:auto;
top:100px;
bottom:100px;
position:absolute;
_height:100%;
_padding:100px 0;
_top:0;
}
</style>
</body>
</html>


相关链接:
http://www.cnblogs.com/ckmouse/archive/2012/02/14/2351043.html http://www.cnblogs.com/bydclouds/archive/2014/09/24/3991571.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: