纯CSS实现侧边栏/分栏高度自动相等

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<style type="text/css">
.content{overflow:hidden;}
.left{ float:left; width:200px; background-color:#F00; margin-bottom:-3000px; padding-bottom:3000px;}
.right{ float:right; width:200px; background-color:#009; margin-bottom:-3000px; padding-bottom:3000px;}
.main{ margin:0px 200px 0px 200px; background-color:#9C0; height:400px;}

</style>
<body>
<div class="content">
<div class="left"></div>
<div class="right"></div>
<div class="main"></div>
</div>
</body>
</html>

 

posted @ 2012-08-14 14:39  justlancer  阅读(344)  评论(0编辑  收藏  举报