div两列同高

<html>
<head>
<title>div屏幕自适应宽度+两列中间栏等高</title>
<style type="text/css">
body{
padding:0;
margin:0;
text-align:center;
}
#wrapper{
width:90%;
height:auto;
margin:0 auto;
}
#header{width:100%;height:100px;background-color:red;float:left;clear:both;text-align:left;}
#main{width:100%;height:auto;float:left;clear:both;text-align:left;overflow:hidden;}
#left{width:30%;height:auto;float:left;text-align:left;background-color:yellow;}
#right{width:70%;height:auto;float:right;text-align:left;background-color:blue;}
#footer{width:100%;height:100px;float:left;clear:both;text-align:left;background-color:006600;}
#left,#right{padding-bottom:32767px;margin-bottom:-32767px;}
</style>
</head>

<body>
<div id="wrapper">
<div id="header">HEADER<br />HEADER<br />HEADER<br /></div>
<div id="main">
    <div id="left">LEFT<br />LEFT<br />LEFT<br />LEFT<br />LEFT<br />LEFT<br />
    	</div>
    <div id="right">RIGHT<br />RIGHT<br />RIGHT<br /><br />
    	RIGHT<br />RIGHT<br />RIGHT<br /><br />
    	RIGHT<br />RIGHT<br />RIGHT<br /><br />
    	RIGHT<br />RIGHT<br />RIGHT<br /><br />
    	RIGHT<br />RIGHT<br />RIGHT<br /><br />
    	RIGHT<br />RIGHT<br />RIGHT<br /><br />
    </div>
</div>
<div id="footer">FOOTER<br />FOOTER<br />FOOTER<br />FOOTER<br /></div>
</div>
</body>
</html>

你可能感兴趣的:(div)