我正在使用bootstrap前端框架。
我想得到以下结果: 两栏:
下面的示例代码,但不起作用.. see jsfiddle
第一列的新行左侧有填充
<div class="row-fluid">
<div class="span7 tlo">
<div class="span3 tlo2 my_height_box">aabc</div>
<div class="span3 tlo2 my_height_box">aabc</div>
<div class="span3 tlo2 my_height_box">aabc</div>
<div class="span3 tlo2 my_height_box">aabc</div>
<div style="clear: both;" class="span3 tlo2 my_height_box">aabc</div>
<div class="span3 tlo2 my_height_box">aabc</div>
<div class="span3 tlo2 my_height_box">aabc</div>
<div class="span3 tlo2 my_height_box">aabc</div>
</div>
<div class="span5 tlo2">
<h1>AWESOME extra text!</h1>
<h2>THIS i s really C00L</h2>
<h3>My files, my problems ;)</h3>
</div>
</div>
有任何建议吗?
答案 0 :(得分:1)
这是因为你使用:
.row-fluid [class*="span"]:first-child {
margin-left: 0;
}
和
.row-fluid [class*="span"] {
margin-left: 2.127659574468085%;
}
您可以使用clear
删除div中的左边距:
<div style="clear: both; margin-left: 0px;" class="span3 tlo2 my_height_box">aabc</div>
或者用margin-right
答案 1 :(得分:1)
您应该使用嵌套的row-fluid
来完成此任务:http://jsfiddle.net/QQRN4/7/
<div class="row-fluid">
<div class="span7 tlo">
<div class="row-fluid">
<div class="span3 tlo2 my_height_box">aabc</div>
<div class="span3 tlo2 my_height_box">aabc</div>
<div class="span3 tlo2 my_height_box">aabc</div>
<div class="span3 tlo2 my_height_box">aabc</div>
</div>
<div class="row-fluid">
<div class="span3 tlo2 my_height_box">aabc</div>
<div class="span3 tlo2 my_height_box">aabc</div>
<div class="span3 tlo2 my_height_box">aabc</div>
<div class="span3 tlo2 my_height_box">aabc</div>
</div>
</div>
<div class="span5 tlo2">
<h1>AWESOME extra text!</h1>
<h2>THIS i s really C00L</h2>
<h3>My files, my problems ;)</h3>
</div>
</div>