中心对齐叽叽喳喳引导列 [英] Center align a column in twitter bootstrap
问题描述
我已经开始学习Twitter的引导。 我的问题是如何中心水平对齐列,因为Twitter的引导包含12列布局,没有中间的数字。为了更清楚,如果它是11列布局,中间的数字将是6(5列左,1列中间5列右)
I've started learning Twitter Bootstrap. My question is how to center align a column horizontally,because twitter bootstrap contains 12 column layout,there is no middle number. To be more clear if it was 11 column layout,the middle number would have been 6(5 columns left,1 column middle,5 columns right)
推荐答案
现在的问题是正确这里<一个回答href="http://stackoverflow.com/questions/18153234/center-a-div-using-bootstrap-3-markup-or-css">center一个div使用引导3标记或CSS
The question is correctly answered here center a div using Bootstrap 3 markup or css
对于奇数行:即COL-MD-7或COL-大-9使用本
添加COL为中心,以你想要居中列。
Add col-centered to the column you want centered.
<div class="col-lg-11 col-centered">
和添加到您的样式表:
.col-centered{
float: none;
margin: 0 auto;
}
对于偶数行:即COL-MD-6或COL-大-10使用本
只需使用引导3的偏移山坳类。即,
Simply use bootstrap 3's offset col class. i.e.,
<div class="col-lg-10 col-lg-offset-1">
这篇关于中心对齐叽叽喳喳引导列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!