css - Bootstrap 3 : what's the default syntax for always be a certain grid size

标签 css twitter-bootstrap

我想要一个 4 列布局,但我不想指定我希望每个列在小、中和大分辨率下都是 3 个网格宽。我认为可能其中之一是默认设置,但我想每个人都认为它是默认设置是如此明显,以至于我还没有找到它的任何文档(或者我实际上必须指定吗?)。

如果有人可以提供任何提示,将不胜感激

最佳答案

Grid system: Introduction

  • Grid classes apply to devices with screen widths greater than or equal to the breakpoint sizes, and override grid classes targeted at smaller devices. Therefore, [for example] applying any .col-md- class to an element will not only affect its styling on medium devices but also on large devices if a .col-lg- class is not present.

另见 https://github.com/twbs/bootlint/wiki/E029 ,这是关于使用冗余网格类的相关错误:

For example, class="col-sm-6" will make the element 6 columns wide on small (sm), medium (md), and large (lg) screens. Therefore, class="col-sm-6 col-md-6 col-lg-6" and class="col-sm-6 col-md-6" are both equivalent to class="col-sm-6", which should be preferred since it's simpler and less verbose.

因此,如果您希望宽度适用于所有屏幕,请仅使用 col-xs-。尽管通常使用 col-sm- 来代替,这样列会堆叠在 xs 屏幕上,由于 XS 屏幕太窄,这通常对用户更友好。

关于css - Bootstrap 3 : what's the default syntax for always be a certain grid size,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26685056/

相关文章:

css - 用于阴影的双底边框

javascript - 如何将动态创建的复选框添加到 Bootstrap 行

javascript - Bootstrap 缩略图通过 Angular-Vertilize 保持高度

css - 具有渐变背景的动态宽度 Div - IE8 和 IE7

css - 如何将复选框和表单中的标签居中

javascript - 每次模式打开同一个文件

javascript - 如何覆盖 Bootstrap 类以增加导航栏高度?

jquery - 如何以 ajax 形式将 Django 媒体 javascript 即时添加到小部件中?

html - WordPress 下拉菜单问题

css - 如何使用:empty pseudo-class and content property together?