【发布时间】:2014-01-06 15:54:28
【问题描述】:
我在引导程序中显示了一个包含 3 行的信息块。我正在使用 bootstrap cols 来使这些响应。对于较小的屏幕,我使用 col-sm-4,对于较大的屏幕,我使用 col-lg-3,以使我的图像适合。
<div class="container clearfix row" style="
width: 100%;
display: table;
margin: 0 auto;">
<!-- post list -->
<div class="test col-sm-4 col-md-4 col-lg-3" style="
display: table-cell;
margin: 0 auto;">
<figure>
<img alt="" src="assets/icons/find-awesome-stories.png">
<figcaption>
<span>
test3
</span>
</figcaption>
<!-- / post item wide -->
</figure>
</div>
<div class="test col-sm-4 col-md-4 col-lg-3" style=" display: table-cell; margin: 0 auto;">
<figure>
<img alt="" src="assets/icons/make-them-yours.png">
<figcaption>
<span>
test 1
</span>
</figcaption>
</figure>
</div>
<div class="test col-sm-4 col-md-4 col-lg-3" style="
display: table-cell;
margin: 0 auto;">
<figure>
<img alt="" src="assets/icons/show-it-off.png">
<figcaption>
test2
</figcaption>
</figure>
</div>
<div class="clear"></div>
</div>
现在,我面临的挑战是我无法将这些元素置于中心位置。我尝试过使用margin: 0 auto,将它们设为table-table-cell,甚至尝试了inline-block 技巧。但似乎没有任何效果。你能帮我解决这个问题吗?谢谢。
这是小提琴http://jsfiddle.net/WJ3U9/2/的链接
【问题讨论】:
标签: html css twitter-bootstrap