为什么列的总和超过12?

时间:2013-11-15 14:13:55

标签: twitter-bootstrap

在twitter bootstrap 3中,网格中的最大列数是12.我无法弄清楚为什么在官方文档中这个例子超过了18: http://getbootstrap.com/css/#grid-example-mixed

<!-- Stack the columns on mobile by making one full-width and the other half-width -->
<div class="row">
  <div class="col-xs-12 col-md-8">.col-xs-12 .col-md-8</div>
  <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
</div>

1 个答案:

答案 0 :(得分:6)

答案是因为总数超过12的行将会换行,从而允许在移动设备上进行不同的演示。您可以使用col-xs类指定要在移动大小中使用的屏幕部分,如果超过12个,则创建其他行,无论是否存在标记。

您可以通过在演示页面上调整浏览器大小来查看此内容。请特别关注移动设备,平板电脑,桌面和响应式重置示例:

http://getbootstrap.com/css/#grid-responsive-resets

http://getbootstrap.com/css/#grid-example-mixed-complete