问题描述
有没有办法让 Bootstrap 3 只使用我的外部网格列?
Is there a way to make Bootstrap 3 use just my outer grid columns?
例如,我将 Bootstrap 构建为使用 10 列而不是 12 列.我将布局划分为 2 列左侧 div 和 8 列右侧 div.
For example, I've built Bootstrap to use 10 columns instead of 12. I've divided my layout to have a 2 column left div and an 8 column right div.
我的主要内容在右边.我想将主要内容分成四个相等的列,应该只是四个 .col-md-2 元素.但是,当我将 .col 元素放入正确的 div 时,Bootstrap 想要将网格重置回十.
My main content goes in the right. I want to divide the main content into four equal columns, which should just be four .col-md-2 elements. Bootstrap however wants to reset the grid back to ten when I place .col elements into the right div.
帮助?
推荐答案
好吧,外列是 8 和 2 = 10,但您希望主内容内的 4 相等,应该等于 10,但您有 col-md-2x 4 = 8 所以你不能这样做,你需要在主要内容中添加到 10.您需要使用宽度为 25% 的列,如果您正确转换为使用 10 列,那么它可能是 col-md-4.
Well the outer column is 8 and 2 = 10 but you want 4 equal inside the main content which should equal 10, but instead you have col-md-2 x 4 = 8 so you can't do that you need to have that add to 10 inside that main content. You'll need use columns that are 25% in width, if you converted correctly to use 10 columns then it's probably col-md-4.
您需要发布小提琴或引导程序以获得更好的答案.或者切换回 12 列并在 LESS 中调整这些列的宽度(不那么痛苦).
You need to post a fiddle or a bootply to get better answers. Or switch back to 12 columns and fiddle with the widths of those columns in LESS (less painful).
这篇关于防止引导程序 3 重置嵌套网格/使用主网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!