1、对父级设置适合CSS高度
左右浮动与 父级窗口 高度 一样。
<html>
<body>
<div style="height:180px; border:1px solid;">
<div style="float:left;height:178px;"></div>
<div style="float:right;height:178px;"></div>
</div>
</body>
</html>
2.clear{ clear:both}
<html>
<body>
<div style="float:left;" id="div1"></div>
<div style="float:right" id="div2"></div>
<div style="clear:both"></div>
</body>
</html>
3、父级div定义 overflow:hidden
<html>
<body>
<div style="overflow:hidden" >
<div style="float:left;"></div>
<div style="float:right"></div>
</div>
</body>
</html>
总结:http://www.divcss5.com/jiqiao/j406.shtml