![](http://imgsrc.baidu.com/forum/pic/item/67da12003af33a87efcdc919c05c10385243b571.jpg?v=tbs)
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<style>
/*@author CGM*/
#div1{width:100%; background:#ffd800; border:1px solid #000000;}
.greenDiv{width:100px; background:#b6ff00; min-height:100px; word-wrap:break-word;float:left}
.redDiv{background:red; width:120px; min-height:120px; float:left;}
/*.clearFix:after,.clearFix:before{content:"."; height:0; visibility:hidden; display:table; clear:both;}*/
/*.clearFix{overflow:auto;_height:1%;}*/
.clearFix{overflow:hidden;_zoom:1}
</style>
</head>
<body>
<div id="div1" class="clearFix">
<div class="greenDiv">这是绿色的div这是绿色的div这是绿色的div这是绿色的div这是绿色的div这是绿色的div这是绿色的div这是绿色的div</div>
<div class="redDiv">这是红色的div,自适应高度。这是红色的div,自适应高度。这是红色的div,自适应高度。这是红色的div,自适应高度。</div>
</div>
<p>这是div外的一个p标签</p>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<style>
/*@author CGM*/
#div1{width:100%; background:#ffd800; border:1px solid #000000;}
.greenDiv{width:100px; background:#b6ff00; min-height:100px; word-wrap:break-word;float:left}
.redDiv{background:red; width:120px; min-height:120px; float:left;}
/*.clearFix:after,.clearFix:before{content:"."; height:0; visibility:hidden; display:table; clear:both;}*/
/*.clearFix{overflow:auto;_height:1%;}*/
.clearFix{overflow:hidden;_zoom:1}
</style>
</head>
<body>
<div id="div1" class="clearFix">
<div class="greenDiv">这是绿色的div这是绿色的div这是绿色的div这是绿色的div这是绿色的div这是绿色的div这是绿色的div这是绿色的div</div>
<div class="redDiv">这是红色的div,自适应高度。这是红色的div,自适应高度。这是红色的div,自适应高度。这是红色的div,自适应高度。</div>
</div>
<p>这是div外的一个p标签</p>
</body>
</html>
![](http://imgsrc.baidu.com/forum/pic/item/67da12003af33a87efcdc919c05c10385243b571.jpg?v=tbs)