日期:2014-05-16 浏览次数:20438 次
<html>
<head>
<title> </title>
<style type="text/css">
* {margin:0; padding:0;}
#d1,#d2,#d3,#d4 {float:left; width:60px;}
#d1 {background-color:red;}
#d2 {background-color:blue;}
#d3 {background-color:yellow;}
#d4 {background-color:black;}
.clearboth {clear: both; font-size: 0; height: 0; margin: 0;}
</style>
</head>
<body>
<div id="d1">1 </div>
<div id="d2">2 </div>
<!-- 清除浮动,换行 -->
<div class="clearboth"> </div>
<div id="d3">3 </div>
<div id="d4">4 </div>
</body>
</html>