问题描述
<div class="row">
<div class="span4"></div>
<div class="span4"></div>
</div>
据我所知,你需要跨越12总。有没有办法仍然居中对齐的两跨我有水平?上述将刚浮到左边。
I understand that you need 12 spans in total. Is there a way to still center align the two spans I have horizontally? The above will just float to the left.
我试图把一个包装周围和保证金auto'ng,但没有任何反应。
I've tried putting a wrapper around them and margin auto'ng it but nothing happens.
我可以去删除跨度类,只是增加一个指定的宽度,但我需要范围
类流动布局。
I can go and remove the span class and just add a specified width but I need span
class for fluid layout.
推荐答案
如果你想中心 span4
的两列可以使用偏移参数是这样的:
If you want to center two columns of span4
you can use offset param like this:
<div class="row">
<div class="span4 offset2"></div>
<div class="span4"></div>
</div>
记住,这可能会崩溃在较低分辨率。为prevent考虑使用流体网格布局。这是通过改变完成
Remember this may crash in lower resolutions. To prevent that think about using fluid grid layout. This is done by changing
<div class="row">
到
<div class="row-fluid">
希望帮助!
这篇关于是否可以水平居中对齐一行引导跨度不加起来12?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!