css - Zurb Foundation 6 Column Center 不起作用

标签 css zurb-foundation-6

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

我使用以下默认类:small-6 小中心列,但在 ChromeDevTool 中,我注意到 .columns:last-child:not(: first-child) 覆盖 .small-centered.columns 的 float 。

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

JSFiddle

最佳答案

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

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

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

关于css - Zurb Foundation 6 Column Center 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34373262/

相关文章:

javascript - 如何使用 Foundation 6 更改小屏幕上顶级链接的功能?

html - 优化首屏 CSS

javascript - Jquery UI 无法与 1.12 版本一起使用

css - Flex 行强制子图像将高度缩小到其他内容的 100%

html - 如何在元素之间放置子弹?

html - Foundation 中 data-open 和 data-toggle 的区别

html - 如何扩大表列之间的差距? CSS表

html - 如何在 Foundation 6 中内联列表 ul?

css - 顶部栏元素未排列

css - 如果边柱高度长,柱子上的基础大空间