<bdo id='yesmv'></bdo><ul id='yesmv'></ul>

  • <tfoot id='yesmv'></tfoot>

      <legend id='yesmv'><style id='yesmv'><dir id='yesmv'><q id='yesmv'></q></dir></style></legend>

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

      <i id='yesmv'><tr id='yesmv'><dt id='yesmv'><q id='yesmv'><span id='yesmv'><b id='yesmv'><form id='yesmv'><ins id='yesmv'></ins><ul id='yesmv'></ul><sub id='yesmv'></sub></form><legend id='yesmv'></legend><bdo id='yesmv'><pre id='yesmv'><center id='yesmv'></center></pre></bdo></b><th id='yesmv'></th></span></q></dt></tr></i><div id='yesmv'><tfoot id='yesmv'></tfoot><dl id='yesmv'><fieldset id='yesmv'></fieldset></dl></div>
      1. 推/拉类在网格系统中做了什么?

        时间:2023-07-31
        1. <legend id='WXQ1L'><style id='WXQ1L'><dir id='WXQ1L'><q id='WXQ1L'></q></dir></style></legend>

            • <i id='WXQ1L'><tr id='WXQ1L'><dt id='WXQ1L'><q id='WXQ1L'><span id='WXQ1L'><b id='WXQ1L'><form id='WXQ1L'><ins id='WXQ1L'></ins><ul id='WXQ1L'></ul><sub id='WXQ1L'></sub></form><legend id='WXQ1L'></legend><bdo id='WXQ1L'><pre id='WXQ1L'><center id='WXQ1L'></center></pre></bdo></b><th id='WXQ1L'></th></span></q></dt></tr></i><div id='WXQ1L'><tfoot id='WXQ1L'></tfoot><dl id='WXQ1L'><fieldset id='WXQ1L'></fieldset></dl></div>

              <tfoot id='WXQ1L'></tfoot>

                <bdo id='WXQ1L'></bdo><ul id='WXQ1L'></ul>

              • <small id='WXQ1L'></small><noframes id='WXQ1L'>

                  <tbody id='WXQ1L'></tbody>
                  本文介绍了推/拉类在网格系统中做了什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  当我查看许多 CSS 网格系统和框架时,它们通常具有标准的列和行设置以及百分比宽度.例如这样的事情:

                  When I look at a lot of CSS grid systems and frameworks they usually have a standard column and row setup with percentage widths. Something like this for example:

                  标准网格列:

                  .col-10 {
                    width: 83.33333%;
                    width: calc(100% / 12 * 10);
                    width: -webkit-calc(100% / 12 * 10);
                    width: -moz-calc(100% / 12 * 10); }
                  

                  但是,除此之外,我还经常看到其他类,例如 .push.pull.比如这样:

                  However, in addition to this, I often see other classes like .push or .pull. For example like this:

                  推/拉类:

                  .push-10 {
                    left: 83.33333%;
                    left: calc(100% / 12 * 10);
                    left: -webkit-calc(100% / 12 * 10);
                    left: -moz-calc(100% / 12 * 10); }
                  
                  .pull-10 {
                    left: -83.33333%;
                    left: calc(-100% / 12 * 10);
                    left: -webkit-calc(-100% / 12 * 10);
                    left: -moz-calc(-100% / 12 * 10); }
                  

                  我已经开始使用网格系统了,但我从来不需要使用这些类.可能是因为我不知道他们在做什么.所以我的问题是:

                  I've come to use grid systems quite a bit but I've never needed to use these classes. Probably because I don't know what they do. So my questions are:

                  1. 推送类通常有什么作用?
                  2. pull 类通常有什么作用?
                  3. 您想在什么时候使用它们?
                  4. 你如何使用它们?
                  5. 提供一个小提琴示例进行演示.

                  推荐答案

                  它们用于重新排序内容.假设您希望您的内容在 HTML 标记中排在第一位,然后是侧边栏,但您希望侧边栏在显示中排在第一位(左侧),然后是内容排在第二位(在右侧).

                  They're for reordering content. Lets say you want your content to come first in the HTML markup and then a sidebar second, but you want the sidebar to come first in the display (on the left) and then the content to come second (on the right).

                  以 Bootstrap 为例:

                  Using Bootstrap as an example:

                  <div class="row">
                      <div class="col-md-9 col-md-push-3">This is content that comes <strong>first in the markup</strong>, but looks like it comes second in the view.</div>
                      <div class="col-md-3 col-md-pull-9">This is the sidebar, that comes <strong>second in the markup</strong>, but looks like it comes first in the view.</div>
                  </div>
                  

                  col-sm-push-3 表示将列从左侧移动 25%(left: 25%).

                  The col-sm-push-3 means move the column 25% from the left (left: 25%).

                  col-sm-pull-9 表示将列向右移动 75%(right: 75%).

                  The col-sm-pull-9 means move the column 75% from the right (right: 75%).

                  所以在这种情况下,大列被推"小列的宽度,而小列被拉"大列的宽度.

                  So in this scenario the large column is being 'pushed' the width of the small column, and the small column is being 'pulled' the width of the large column.

                  使用 Bootstrap 演示

                  类似这样的:

                  .push-10 {
                      left: calc(100% / 12 * 10);
                  }
                  

                  意思是,取容器的宽度(100%),除以网格中的列数(12),再乘以你想要推动它的数字(10).剩下 83.33333333%.

                  Means, take the width of the container (100%), divide it by the number of columns in the grid (12) and multiple it by the number you want to push it by (10). Leaving you with 83.33333333%.

                  这篇关于推/拉类在网格系统中做了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:响应式语义 UI React 网格、列、行 下一篇:困难的 HTML、JavaScript、CSS 网格页面

                  相关文章

                    <legend id='lLNhd'><style id='lLNhd'><dir id='lLNhd'><q id='lLNhd'></q></dir></style></legend>

                  1. <tfoot id='lLNhd'></tfoot>

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

                    • <bdo id='lLNhd'></bdo><ul id='lLNhd'></ul>
                    <i id='lLNhd'><tr id='lLNhd'><dt id='lLNhd'><q id='lLNhd'><span id='lLNhd'><b id='lLNhd'><form id='lLNhd'><ins id='lLNhd'></ins><ul id='lLNhd'></ul><sub id='lLNhd'></sub></form><legend id='lLNhd'></legend><bdo id='lLNhd'><pre id='lLNhd'><center id='lLNhd'></center></pre></bdo></b><th id='lLNhd'></th></span></q></dt></tr></i><div id='lLNhd'><tfoot id='lLNhd'></tfoot><dl id='lLNhd'><fieldset id='lLNhd'></fieldset></dl></div>