【问题标题】:Why is Susy giving my columns a 44.44444% width instead of 50%?为什么 Susy 给我的列的宽度是 44.44444% 而不是 50%?
【发布时间】:2014-09-23 14:04:47
【问题描述】:

当参数中包含 no-gutters 时,无法弄清楚为什么我的列不是 50%?

SCSS:

$susy: (
  global-box-sizing: border-box,
  gutters: 1/4,
  gutter-position: before
);

.columns {
  @include clearfix;
}

.column {   
  .twoColumns & {
    @include span (1 of 2 no-gutters);
  }
}

CSS:

.columns:after {
  content: "";
  display: table;
  clear: both;
}

.twoColumns .column {
  width: 44.44444%;
  float: left;
}

【问题讨论】:

    标签: css sass css-float compass-sass susy-compass


    【解决方案1】:

    您必须使用内部值设置装订线位置才能获得 50% 的列:

    $susy: (
      global-box-sizing: border-box,
      gutters: 1/4,
      gutter-position: inside
    );
    
    .columns {
      @include clearfix;
    }
    
    .column {   
      .twoColumns & {
        @include span (1 of 2 no-gutters);
      }
    }
    

    【讨论】:

    • 如果您真的不想要装订线,您也可以将设置更改为0null
    猜你喜欢
    • 2015-07-13
    • 1970-01-01
    • 1970-01-01
    • 2015-03-18
    • 2015-02-21
    • 1970-01-01
    • 2016-12-09
    • 1970-01-01
    • 2020-07-19
    相关资源
    最近更新 更多