等高布局

描述:左右两列高度自适应扩展,并且相等;

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<style>
body{margin:0;}
.wrap{ width:900px;margin:0 auto;overflow:hidden;}
.left{width:200px;background:Red;float:left;padding-bottom:10000px;margin-bottom:-10000px;} //主要是靠margin-bottom和padding-bottom
.right{width:700px;background:blue;float:right;padding-bottom:10000px;margin-bottom:-10000px;}
</style>
</head>
<body>
<div class="wrap">
    <div class="left">
        &nbsp;&nbsp;页面内容<br/>
        &nbsp;&nbsp;页面内容<br/>
        &nbsp;&nbsp;页面内容<br/>
        &nbsp;&nbsp;页面内容<br/>
        &nbsp;&nbsp;页面内容<br/>
        &nbsp;&nbsp;页面内容<br/>
        &nbsp;&nbsp;页面内容<br/>
    </div>
    <div class="right">
        &nbsp;&nbsp;页面内容<br/>
        &nbsp;&nbsp;页面内容<br/>
        &nbsp;&nbsp;页面内容<br/>
        &nbsp;&nbsp;页面内容<br/>
        &nbsp;&nbsp;页面内容<br/>
        &nbsp;&nbsp;页面内容<br/>
        &nbsp;&nbsp;页面内容<br/>
        &nbsp;&nbsp;页面内容<br/>
        &nbsp;&nbsp;页面内容<br/>
        &nbsp;&nbsp;页面内容<br/>
        &nbsp;&nbsp;页面内容<br/>
        &nbsp;&nbsp;页面内容<br/>
        &nbsp;&nbsp;页面内容<br/>
        &nbsp;&nbsp;页面内容<br/>
    </div>
</div>
</body>
</html>

 

posted @ 2017-04-05 17:37  念念念不忘  阅读(87)  评论(0)    收藏  举报