简体   繁体   English

是否可以将值0传递给span(0)?

[英]Is it possible to pass a value of 0 to span(0)?

Long tried to create a responsive navigation. 长期尝试创建响应式导航。 But still turned out. 但是还是事实证明。 But I'm still not sure I did the right thing. 但是我仍然不确定我做对了什么。 Because I passed a value of 0 in the span. 因为我在跨度中传递了0值。 Or so it is still possible to do? 还是有可能这样做? It works :) 有用 :)

$big: (columns: 24, gutters: 1/2,math: fluid,gutter-position: split )

@include susy-breakpoint(700px, $big)
    .nav-item // is ui>li.nav-item
        @include span(0 border-box)

No, this is not a proper way to use Susy. 不,这不是使用Susy的正确方法。 If you look at the output, you will see that you get width: -1.38889%; 如果查看输出,将看到width: -1.38889%; which is not valid CSS. 这是无效的CSS。 It works because browsers ignore invalid code - but it's not a good idea, and it's not a meaningful use of Susy. 之所以有效,是因为浏览器会忽略无效的代码-但这不是一个好主意,也不是Susy的有意义的用法。

The only grid-output you need is gutters, so that's all you should ask Susy for. 您唯一需要的网格输出是装订线,因此您只需要向Susy索取。 The rest you can do with plain css: 其余的您可以使用普通CSS执行:

.nav-item {
  @include gutters;
  box-sizing: border-box;
  float: left;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM