css - 最大宽度设置不适用于行

标签 css responsive-design zurb-foundation

我正在使用 ZF6。我正在使用 SASS 版本。 现在创建了一个新行。 它的宽度设置为

max-width: 75rem;

我试图在 css 中更改行宽,但它不起作用。 我还尝试更改 SCSS 文件中的变量设置,但没有成功。 请告诉我如何解决这个问题。 谢谢。

最佳答案

如果我没理解错的话,您是想创建一个自定义宽度的自定义行吗?

为此,您可以使用自己的类并包含 grid-row,然后添加您自己的 max-width

如果这是你的 html:

<div class="custom-row-class">
</div>

然后在你的scss文件中,写

.custom-row-class {
  @include row-width();
  max-width: 75em;
}

请注意,如果您的行位于另一个包含 div 的行中,它将不能比这更宽,因为您的自定义 div 具有 max-width缩小到包含的 div,width: 100% 也会缩小以适应包含的 div。

这里是文档的一些链接。我发现 Foundation 5 文档更容易理解这一点。另请查看 _grid.scss 文件以获取更多信息。

http://foundation.zurb.com/sites/docs/v/5.5.3/components/grid.html#customize-with-sass

http://foundation.zurb.com/sites/docs/grid.html#building-semantically

关于css - 最大宽度设置不适用于行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39093361/

相关文章:

jquery - slider 未居中,段落显示与段落重叠

css - CSS中的响应字体大小

css - NativeScript Playground - 未应用内置类

safari - Safari 最大宽度 : 100% ect 的 CSS 响应问题

html - 响应式问题 - 3 列布局

html - 响应式设计 : Is it better to hide or to change position of elements?

zurb-foundation - Zurb 基金会自定义 Javascript

css - 如何在 Zurb Foundation 4/5 全屏中制作行?

html - 到外部样式表的异常链接

html - 创建右侧半圆的菜单(导航菜单)