【问题标题】:Zurb Foundation 6 Column Center doesn't workZurb Foundation 6 柱中心不起作用
【发布时间】:2015-12-19 17:08:22
【问题描述】:

我尝试在 Zurb Foundation 6 中将一列居中。

我正在使用以下默认类:small-6 small-centered columns,但在 ChromeDevTool 中,我注意到 .columns:last-child:not(:first-child) 的浮点数覆盖了.small-centered.columns 的浮点数。

当我插入多列时,一切正常,除了最后一列。 是基金会的bug吗?

JSFiddle

【问题讨论】:

    标签: css zurb-foundation-6


    【解决方案1】:

    不,这不是 Foundation 中的错误,这是预期的行为。如果您查看http://foundation.zurb.com/sites/docs/grid.html#incomplete-rows,它会描述他们这样做的原因。

    如果您想覆盖此行为,这很容易。只需添加此 css 即可覆盖浮动。

    .columns:last-child:not(:first-child) {
      float:none;
    }
    

    【讨论】:

    • 如果您将列居中,这不是预期的行为。向下滚动到文档的居中部分以查看。 @Giovanni 在 thr fiddle 中的第一个示例应该居中。
    • @ColinMarshall - 这是因为 Giovanni 在row 中有另一个元素。有关示例,请参见 jsfiddle.net/ue6tp76w
    • 啊,我看到 h6 导致了这种行为。很好的发现。
    猜你喜欢
    • 1970-01-01
    • 2013-08-19
    • 2018-05-04
    • 2017-02-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多