+ -
当前位置:首页 → 问答吧 → 求助,就是弄不清楚,为什么只有当box1和box2向右浮动时box3才会插空而上

求助,就是弄不清楚,为什么只有当box1和box2向右浮动时box3才会插空而上

时间:2010-12-03

来源:互联网

2010-12-03_105647.jpg (20.57 KB)
2010-12-3 11:02
求助,就是弄不清楚,为什么只有当box1和box2向右浮动时box3才会插空而上,而box1和box2向左浮动时,box3与narrow却有间隔
<!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">
#narrow {
           border:1px solid black;
           float:left;
           width:200px;
           height:10em;
}

#container {
           height:25em;
           width:500px;
           border:1px solid black;
}
.box {
           height:12em;
           width:9em;
           border:1px solid black;
}

.bg1 {
       float:left;
         
}
.bg2 {
       float:left;
      
}
.bg3 {
         
}
</style>

<body>
<div id="container">
              <div id="narrow">narrow</div>
       
              <div id="box1" class="box bg1">box1</div>
              <div id="box2" class="box bg2">box2</div>
              <div id="box3" class="box bg3">box3</div>
</div>
</body>
</html>

[ 本帖最后由 alwayser 于 2010-12-3 11:07 编辑 ]

作者: alwayser   发布时间: 2010-12-03

bg3元素上边框..不能比在它之前的元素的底边框更高

作者: businessDiv   发布时间: 2010-12-03