twitter-bootstrap Twitter Bootstrap:抵消列?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12983826/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Twitter Bootstrap: offsetting columns?
提问by StackOverflowNewbie
I'm looking into Bootstrap and am wondering about offsetting columns: http://twitter.github.com/bootstrap/scaffolding.html#gridSystem
我正在研究 Bootstrap 并且想知道偏移列:http: //twitter.github.com/bootstrap/scaffolding.html#gridSystem
The documentation says that the columns "should always add up to 12 for each row." Then it gives an example of offsetting columns:
文档说这些列“应该总是每行加起来 12”。然后它给出了一个偏移列的例子:
<div class="row">
<div class="span4">...</div>
<div class="span3 offset2">...</div>
</div>
Questions:
问题:
- The columns do not add up to 12. It only totals 7. Or if you count the offset: 9. Was this just a bad example or something?
- Why would I want to offset anything? Is this just to handle the content of the layout of my site better?
- 这些列加起来不是 12。它总共只有 7。或者如果你计算偏移量:9。这只是一个坏例子还是什么?
- 为什么我要抵消任何东西?这只是为了更好地处理我网站布局的内容吗?
回答by jonschlinkert
To clarify what Rob is saying, what you are missing is that all of the grid examples are using 9 columns. The reason is that the sidebar (side navigation) in the docs is itself taking up 3 columns.
为了澄清 Rob 在说什么,您缺少的是所有网格示例都使用 9 列。原因是文档中的侧边栏(侧边导航)本身占据了 3 列。
The entire width of the bootstrap documentation is 12 columns, minus 3 for the side navigation, which leaves 9 columns for the grid demo. Make sense?
bootstrap 文档的整个宽度是 12 列,侧面导航减去 3 列,剩下 9 列用于网格演示。说得通?
回答by Rob
The sidebar is a span3. So the entire page width adds up to 12. The content section it's displayed in is only a span9.
侧边栏是一个span3。所以整个页面宽度加起来为12。它显示的内容部分只有一个span9。

