【问题标题】:What is the difference between the **col-md-4** class and the **col-xs-4** class in BootStrap template?BootStrap 模板中的 **col-md-4** 类和 **col-xs-4** 类有什么区别?
【发布时间】:2015-10-20 14:53:43
【问题描述】:

我是 Twitter BootStrap 的新手,我有以下疑问。

我已经清楚 BootStrap 网格布局是如何工作的,所以如果我有这样的东西:

<div class="row">
    <div class="col-md-4">
    <div class="col-md-4">
    <div class="col-md-4">
</div>

简单来说就是我把一行分成了4维的3列(因为BootStrap的网格布局是基于12列的)

我的疑问与这些列的 md 定义有关。

我知道我也可以使用 &lt;div class="col-xs-4"&gt; 之类的东西

col-md-4 类和 col-xs-4 类有什么区别?

【问题讨论】:

标签: html twitter-bootstrap css twitter-bootstrap-3


【解决方案1】:

基本上,

它将定义 xl(超大屏幕)和 md(中型屏幕)中的列的行为;

例如:当屏幕为 xl 时,列的比例为 12 是列的总和,如果屏幕变小,列将中断。但是,如果您使用 md 进行设置,您可以使屏幕更小,但在尺寸达到之前列不会中断:

  • xs(用于手机)
  • sm(用于平板电脑)
  • md(适用于台式机)
  • lg(适用于较大的桌面)

参考: https://getbootstrap.com/examples/grid/

【讨论】:

    猜你喜欢
    • 2014-03-05
    • 2013-11-20
    • 2014-08-02
    • 2015-06-19
    • 2013-12-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多