머리와 꼬리가 중간에 스스로 적응하는 배치를 고정시킨다
1384 단어 스스로 적응하다
<!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