我对 twitter bootstrap 世界和基于 % 的宽度相对较新,并且对应该很容易完成的事情感到非常困惑。
我正在尝试将浮动.subimg
在我的页面上的每个左侧居中。显然margin:0 auto
行不通,因为它不是静态网格。我在父 div 上使用了文本对齐中心,但无济于事。我的标记如下:
<style>
.subimg{float:left;}
.row-fluid{text-align:center;}
</style>
<div class="row-fluid"><!-- begin row -->
<div class="span12 subimgstrip">
<div class="subimg">
<a href="#">
<img src="/wp-content/themes/wordpress-bootstrap/img/products/infection/1.jpg"/>
<h6>Customize Settings</h6>
</a>
</div>
<div class="subimg">
<a href="#">
<img src="/wp-content/themes/wordpress-bootstrap/img/products/infection/2.jpg"/>
<h6>Set Specific Criteria</h6>
</a>
</div>
<div class="subimg">
<a href="#">
<img src="/wp-content/themes/wordpress-bootstrap/img/products/infection/3.jpg"/>
<h6>Customize Alerts</h6>
</a>
</div>
<div class="subimg">
<a href="#">
<img src="/wp-content/themes/wordpress-bootstrap/img/products/infection/4.jpg"/>
<h6>Create Antibiograms</h6>
</a>
</div>
<div class="subimg">
<a href="#">
<img src="/wp-content/themes/wordpress-bootstrap/img/products/infection/5.jpg"/>
<h6>Isolate Information</h6>
</a>
</div>
</div>
</div><!-- end row -->