日期:2014-05-17  浏览次数:21381 次

关于DIV+CSS的一个弱问题.....
<!DOCTYPE   HTML   PUBLIC   "-//W3C//DTD   HTML   4.01   Transitional//EN "
"http://www.w3.org/TR/html4/loose.dtd ">
<html>
<head>
<title> 津报网-2007年全国两会 </title>
</head>
<style   type= "text/css ">
body   {  
BACKGROUND:   #670000;
}  
/*   布局   */
.main3{
width:760px;
background-color:   #FFFFFF;
}
.box6{
width:240px;
float:   left;
background-color:   #00FFFF;
margin-right:   5px;
margin-bottom:   0px;
margin-left:   5px;
}
.box7{
float:   left;
width:290px;
background-color:   #FF00FF;
margin-right:   0px;
margin-bottom:   0px;
margin-left:   0px;
}
.box8{
float:   right;
width:210px;
background-color:   #FFFF00;
margin-right:   5px;
margin-bottom:   0px;
margin-left:   5px;
}  


</style>
<body>

<div   class= "main3 ">
<div   class= "box6 "> 11
    </div>
<div   class= "box7 "> 22
    </div>
<div   class= "box8 "> 33
    </div>
</div>
</body>
</html>  

怎么也不能一行对齐....宽度加一起是760px啊...郁闷...大家帮忙看看,谢谢

------解决方案--------------------
这是经典的IE magin双倍浮动BUG
解决方案:
.box6{
float: left;
width:240px;
background-color: #00FFFF;
margin: 0 5px;
display:inline; /*解决magin双倍浮动BUG*/
}