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

<!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

posted @ 2014-09-25 09:43  方方和圆圆  阅读(753)  评论(0编辑  收藏  举报

再过一百年, 我会在哪里?