JSFiddle:http: //jsfiddle.net/2vLYn/
我有这个表格:
如果你看图片,第三个盒子在下面,因为第二个盒子把它往下推,有没有办法让第三个盒子坐在第一个盒子下面,这样就没有那么多空白了?
这是HTML
<div id="wrapper"> <!--Open Main Wrapper -->
<div class="selection_list">
<div style="padding:3px; margin:3px; font-size:16px;"><strong>Title</strong></div>
<div class="selectionleft">Checkbox</div>
<div class="selectionright"><strong>This is where some text will go</strong></div>
</div>
<div class="selection_list">
<div style="padding:3px; margin:3px; font-size:16px;"><strong>Title</strong></div>
<div class="selectionleft">Checkbox</div>
<div class="selectionright"><strong>This is where some text will go</strong></div>
<div style="clear:both;"></div>
<div class="selectionleft">Checkbox</div>
<div class="selectionright"><strong>This is where some text will go</strong></div>
<div style="clear:both;"></div>
<div class="selectionleft">Checkbox</div>
<div class="selectionright"><strong>This is where some text will go</strong></div>
<div style="clear:both;"></div>
<div class="selectionright"><strong>This is where some text will go</strong></div>
<div style="clear:both;"></div>
<div class="selectionright"><strong>This is where some text will go</strong></div>
<div style="clear:both;"></div>
</div>
<div class="selection_list">
<div style="padding:3px; margin:3px; font-size:16px;"><strong>Title</strong></div>
<div class="selectionleft">Checkbox</div>
<div class="selectionright"><strong>This is where some text will go</strong></div>
</div>
<div class="selection_list">
<div style="padding:3px; margin:3px; font-size:16px;"><strong>Title</strong></div>
<div class="selectionright"><strong>This is where some text will go</strong></div>
</div>
<div style="clear:both;"></div>
</div> <!--Close Main Wrapper -->
这是CSS
#wrapper {
width:1000px;
background-color:#ffffff;
margin: 0px auto 0px auto;
border-right-width:1px;
border-right-color:#fff;
border-right-style:solid;
border-left-width:1px;
border-left-color:#fff;
border-left-style:solid;
border-bottom-width:1px;
border-bottom-style:solid;
border-bottom-color:#fff;
-moz-border-bottom-left-radius: 7px;
border-bottom-left-radius: 7px;
-moz-border-bottom-right-radius: 7px;
border-bottom-right-radius: 7px;
}
.selection_list {
width:460px;
margin:10px;
padding:5px;
float:left;
background-color:#eeeeee;
-moz-border-radius: 15px;
border-radius: 15px;
}
.selectionleft{
float:left;
width:60px;
padding:0px;
margin:5px;
}
.selectionright{
float:left;
padding:8px;
margin:5px;
font-size:14px;
}