• <small id='69sl3'></small><noframes id='69sl3'>

    <legend id='69sl3'><style id='69sl3'><dir id='69sl3'><q id='69sl3'></q></dir></style></legend>

        <bdo id='69sl3'></bdo><ul id='69sl3'></ul>

      1. <i id='69sl3'><tr id='69sl3'><dt id='69sl3'><q id='69sl3'><span id='69sl3'><b id='69sl3'><form id='69sl3'><ins id='69sl3'></ins><ul id='69sl3'></ul><sub id='69sl3'></sub></form><legend id='69sl3'></legend><bdo id='69sl3'><pre id='69sl3'><center id='69sl3'></center></pre></bdo></b><th id='69sl3'></th></span></q></dt></tr></i><div id='69sl3'><tfoot id='69sl3'></tfoot><dl id='69sl3'><fieldset id='69sl3'></fieldset></dl></div>
      2. <tfoot id='69sl3'></tfoot>

        “col-md-4"中数字的含义,"col-xs-1"、“col-lg-2"在引

        Meaning of numbers in quot;col-md-4quot;,quot; col-xs-1quot;, quot;col-lg-2quot; in Bootstrap(“col-md-4中数字的含义,col-xs-1、“col-lg-2在引导程序中)

        <small id='DtjUt'></small><noframes id='DtjUt'>

        • <i id='DtjUt'><tr id='DtjUt'><dt id='DtjUt'><q id='DtjUt'><span id='DtjUt'><b id='DtjUt'><form id='DtjUt'><ins id='DtjUt'></ins><ul id='DtjUt'></ul><sub id='DtjUt'></sub></form><legend id='DtjUt'></legend><bdo id='DtjUt'><pre id='DtjUt'><center id='DtjUt'></center></pre></bdo></b><th id='DtjUt'></th></span></q></dt></tr></i><div id='DtjUt'><tfoot id='DtjUt'></tfoot><dl id='DtjUt'><fieldset id='DtjUt'></fieldset></dl></div>
            <bdo id='DtjUt'></bdo><ul id='DtjUt'></ul>
              <tbody id='DtjUt'></tbody>
            1. <tfoot id='DtjUt'></tfoot><legend id='DtjUt'><style id='DtjUt'><dir id='DtjUt'><q id='DtjUt'></q></dir></style></legend>

                  本文介绍了“col-md-4"中数字的含义,"col-xs-1"、“col-lg-2"在引导程序中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我对新 Bootstrap 中的网格系统感到困惑,尤其是这些类:

                  I am confused with the grid system in the new Bootstrap, particularly these classes:

                  col-lg-*
                  col-md-*
                  col-xs-*
                  

                  (其中 * 表示某个数字).

                  (where * represents some number).

                  谁能解释一下:

                  1. 这个数字如何对齐网格?
                  2. 如何使用这些数字?
                  3. 它们实际代表什么?
                  1. How that number is aligning the grids?
                  2. How to use these numbers?
                  3. What they actually represent?

                  推荐答案

                  仅适用于 Bootstrap 3.

                  忽略字母(xssmmdlg)现在我将从数字开始......

                  Ignoring the letters (xs, sm, md, lg) for now, I'll start with just the numbers...

                  • 数字 (1-12) 代表任何 div 总宽度的一部分
                  • 所有 div 分为 12 列
                  • 所以,col-*-6 跨越 12 列中的 6 列(宽度的一半),col-*-12 跨越 12 列中的 12 列(整个宽度)等
                  • the numbers (1-12) represent a portion of the total width of any div
                  • all divs are divided into 12 columns
                  • so, col-*-6 spans 6 of 12 columns (half the width), col-*-12 spans 12 of 12 columns (the entire width), etc

                  所以,如果你想两个相等的列跨越一个 div,写

                  So, if you want two equal columns to span a div, write

                  <div class="col-xs-6">Column 1</div>
                  <div class="col-xs-6">Column 2</div>
                  

                  或者,如果您希望三个不相等的列跨越相同的宽度,您可以这样写:

                  Or, if you want three unequal columns to span that same width, you could write:

                  <div class="col-xs-2">Column 1</div>
                  <div class="col-xs-6">Column 2</div>
                  <div class="col-xs-4">Column 3</div>
                  

                  您会注意到列数总和为 12.它可能小于 12,但请注意如果超过 12,因为您的违规 div 会下降到下一行(不是 .row,这完全是另一回事).

                  You'll notice the # of columns always add up to 12. It can be less than twelve, but beware if more than 12, as your offending divs will bump down to the next row (not .row, which is another story altogether).

                  您还可以在列中嵌套列,(最好在它们周围加上 .row 包装器),例如:

                  You can also nest columns within columns, (best with a .row wrapper around them) such as:

                  <div class="col-xs-6">
                    <div class="row">
                      <div class="col-xs-4">Column 1-a</div>
                      <div class="col-xs-8">Column 1-b</div>
                    </div>
                  </div>
                  <div class="col-xs-6">
                    <div class="row">
                      <div class="col-xs-2">Column 2-a</div>
                      <div class="col-xs-10">Column 2-b</div>
                    </div>
                  </div>
                  

                  每组嵌套的 div 也最多跨越其父 div 的 12 列.注意: 由于每个 .col 类的两边都有 15px 的填充,您通常应该将嵌套列包装在具有 -15px 的 .row 中边距.这样可以避免重复填充并保持嵌套和非嵌套 col 类之间的内容对齐.

                  Each set of nested divs also span up to 12 columns of their parent div. NOTE: Since each .col class has 15px padding on either side, you should usually wrap nested columns in a .row, which has -15px margins. This avoids duplicating the padding and keeps the content lined up between nested and non-nested col classes.

                  -- 你没有具体询问 xs, sm, md, lg 的用法,但是它们是齐头并进的,所以我忍不住要谈一谈……

                  -- You didn't specifically ask about the xs, sm, md, lg usage, but they go hand-in-hand so I can't help but touch on it...

                  简而言之,它们用于定义该类应适用的屏幕尺寸:

                  In short, they are used to define at which screen size that class should apply:

                  • xs = 超小屏幕(手机)
                  • sm = 小屏幕(平板电脑)
                  • md = 中等屏幕(某些桌面)
                  • lg = 大屏幕(剩余桌面)
                  • xs = extra small screens (mobile phones)
                  • sm = small screens (tablets)
                  • md = medium screens (some desktops)
                  • lg = large screens (remaining desktops)

                  阅读"网格选项"更多详细信息,请参阅官方 Bootstrap 文档中的章节.

                  Read the "Grid Options" chapter from the official Bootstrap documentation for more details.

                  您应该通常使用多个列类对 div 进行分类,以便它的行为根据屏幕大小而有所不同(这是引导程序响应的核心).例如:具有 col-xs-6col-sm-4 类的 div 将跨越手机屏幕的一半 (xs) 和屏幕的 1/3在平板电脑上(sm).

                  You should usually classify a div using multiple column classes so it behaves differently depending on the screen size (this is the heart of what makes bootstrap responsive). eg: a div with classes col-xs-6 and col-sm-4 will span half the screen on the mobile phone (xs) and 1/3 of the screen on tablets(sm).

                  <div class="col-xs-6 col-sm-4">Column 1</div> <!-- 1/2 width on mobile, 1/3 screen on tablet) -->
                  <div class="col-xs-6 col-sm-8">Column 2</div> <!-- 1/2 width on mobile, 2/3 width on tablet -->
                  

                  注意:根据下面的评论,给定屏幕尺寸的网格类适用于该屏幕尺寸和更大,除非另一个声明覆盖它(即 col-xs-6 col-md-4 跨越 xs sm 上的 6 列,以及 md<上的 4 列/code> lg,即使 smlg 从未明确声明)

                  NOTE: as per comment below, grid classes for a given screen size apply to that screen size and larger unless another declaration overrides it (i.e. col-xs-6 col-md-4 spans 6 columns on xs and sm, and 4 columns on md and lg, even though sm and lg were never explicitly declared)

                  注意:如果你不定义xs,它将默认为col-xs-12(即col-sm-6smmdlg 屏幕上是宽度的一半,但在 xs<上是全宽/code> 屏幕).

                  NOTE: if you don't define xs, it will default to col-xs-12 (i.e. col-sm-6 is half the width on sm, md and lg screens, but full-width on xs screens).

                  注意:如果您的 .row 包含超过 12 个列,实际上完全没问题,只要您知道它们会如何反应.--这是一个有争议的问题,并不是每个人都同意.

                  NOTE: it's actually totally fine if your .row includes more than 12 cols, as long as you are aware of how they will react. --This is a contentious issue, and not everyone agrees.

                  这篇关于“col-md-4"中数字的含义,"col-xs-1"、“col-lg-2"在引导程序中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Crop the image using JavaScript(使用 JavaScript 裁剪图像)
                  How do I take code from Codepen, and use it locally?(如何从 Codepen 获取代码并在本地使用?)
                  Overlay HTML5 canvas over image(在图像上覆盖 HTML5 画布)
                  How i quot;writequot; an icon in the context canvas?(我如何“写作上下文画布中的图标?)
                  webkit css resize doesn#39;t work with canvas as child?(webkit css resize 不适用于儿童画布?)
                  Bootstrap grid won#39;t work using xs columns(引导网格无法使用 xs 列)

                  <small id='KprAu'></small><noframes id='KprAu'>

                1. <tfoot id='KprAu'></tfoot>
                  <i id='KprAu'><tr id='KprAu'><dt id='KprAu'><q id='KprAu'><span id='KprAu'><b id='KprAu'><form id='KprAu'><ins id='KprAu'></ins><ul id='KprAu'></ul><sub id='KprAu'></sub></form><legend id='KprAu'></legend><bdo id='KprAu'><pre id='KprAu'><center id='KprAu'></center></pre></bdo></b><th id='KprAu'></th></span></q></dt></tr></i><div id='KprAu'><tfoot id='KprAu'></tfoot><dl id='KprAu'><fieldset id='KprAu'></fieldset></dl></div>
                      <bdo id='KprAu'></bdo><ul id='KprAu'></ul>
                    • <legend id='KprAu'><style id='KprAu'><dir id='KprAu'><q id='KprAu'></q></dir></style></legend>
                        <tbody id='KprAu'></tbody>