<legend id='EwJW7'><style id='EwJW7'><dir id='EwJW7'><q id='EwJW7'></q></dir></style></legend>
      <bdo id='EwJW7'></bdo><ul id='EwJW7'></ul>

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

      <tfoot id='EwJW7'></tfoot>

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

      2. Susy 2:具有流动主要内容区域的固定宽度侧边栏

        时间:2023-08-01
        <i id='iyvI3'><tr id='iyvI3'><dt id='iyvI3'><q id='iyvI3'><span id='iyvI3'><b id='iyvI3'><form id='iyvI3'><ins id='iyvI3'></ins><ul id='iyvI3'></ul><sub id='iyvI3'></sub></form><legend id='iyvI3'></legend><bdo id='iyvI3'><pre id='iyvI3'><center id='iyvI3'></center></pre></bdo></b><th id='iyvI3'></th></span></q></dt></tr></i><div id='iyvI3'><tfoot id='iyvI3'></tfoot><dl id='iyvI3'><fieldset id='iyvI3'></fieldset></dl></div>
        <legend id='iyvI3'><style id='iyvI3'><dir id='iyvI3'><q id='iyvI3'></q></dir></style></legend>

            <tfoot id='iyvI3'></tfoot>

              • <bdo id='iyvI3'></bdo><ul id='iyvI3'></ul>

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

                  <tbody id='iyvI3'></tbody>
                  本文介绍了Susy 2:具有流动主要内容区域的固定宽度侧边栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  使用 Susy 2(候选发布版),我试图弄清楚如何使用固定宽度的侧边栏创建简单的流体布局 - 无论是左侧还是右侧 - 我很高兴使用第一个和最后一个关键字.谁能给我任何关于如何在 Susy 2 中执行此操作的指示?

                  Using Susy 2 (release candidate), I'm trying to figure out how to create a simple fluid layout with a fixed width sidebar - either left position or right - I'm happy using the first and last keywords. Can anyone give me any pointers on how to do this within Susy 2?

                  谢谢!

                  推荐答案

                  有几种方法可以混合固定/流体布局,具体取决于您自己的具体情况.

                  There are a few ways to mix fixed/fluid layouts, depending on your own specific case.

                  1. 隔离侧边栏.

                  1. Isolate the sidebar.

                  浮动隔离是保持浮动相互独立的一种很酷的方法.

                  Float isolation is a cool a way of keeping floats independent from each other.

                  .side {
                    @include span(3 static isolate);
                  }
                  
                  .main {
                    @include full;
                    padding-left: span(3 static wide);
                  }
                  
                  // or...
                  
                  .main {
                    margin-left: span(3 static wide);
                  }
                  

                  span(3 static) 将跨越 3 列,使用您的 column-width 设置/单位.添加 isolate 将设置负右边距,以防止占用水平空间.添加 wide 将在该宽度中包含一个额外的装订线.你也可以使用像 200px 这样的任意宽度.这取决于你.

                  span(3 static) will span 3-columns, using your column-width setting/units. Adding isolate will set negative right margins, to keep it from taking horizontal space. Adding wide, will include an extra gutter in that width. You could also use arbitrary widths like 200px instead. It's up to you.

                  从流程中完全移除侧边栏.

                  Remove the sidebar from the flow entirely.

                  如果从流程中删除侧边栏是安全的,有时最简单的方法是绝对定位它,并为主要内容添加相等的填充.使用 Susy 2,可能看起来像这样:

                  If it's safe to remove the sidebar from the flow, it is sometimes simplest to position it absolutely, and add equal padding to the main content. Using Susy 2, that could look something like this:

                  .side {
                    position: absolute;
                    left: 0;
                    top: 0;
                    width: span(3 static);
                  }
                  
                  .main {
                    padding-left: span(3 static wide);
                  }
                  

                • 使用布局上下文技巧.

                • Use a layout-context hack.

                  还有一些方法可以创建一个新的布局上下文来填充浮动后的剩余空间.其中最简单的是 overflow: hidden;

                  There are also ways to create a new layout context that will fill the remaining space after a float. The simplest of those is overflow: hidden;

                  .side {
                    @include span(3 static);
                  }
                  
                  .main {
                    overflow: hidden;
                  }
                  

                  这样做的缺点是如果您出于任何原因需要溢出.还有其他技术,也有其他的缺点,比如这个:

                  The downside of that is if you need to overflow for any reason. There are other techniques, that have other hackey downsides, like this one:

                  .main {
                    display: table-cell;
                    vertical-align: top;
                    width: 10000px;
                  }
                  

                • 这篇关于Susy 2:具有流动主要内容区域的固定宽度侧边栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Boostrap 3 - col-md-4 到 col-sm-6,或 3x2 到 2x3 的网格 下一篇:如何使离子网格像 Ionic 2 中的按钮一样可点击

                  相关文章

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

                  2. <legend id='wKgvO'><style id='wKgvO'><dir id='wKgvO'><q id='wKgvO'></q></dir></style></legend>

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

                    <tfoot id='wKgvO'></tfoot>