css - 为什么我的重复函数在 css 的网格属性中不起作用?

标签 css grid-layout css-grid

这段代码工作正常:

grid: [row1-start] 'header header header header header' auto [row1-end]
    [row2-start] 'menu content content content content' auto [row2-end]
    [row3-start] 'footer footer footer footer footer' auto [row3-end] / 1fr 1fr 1fr 1fr 1fr;

但是当我使用 repeat() 函数而不是五个 1fr 时,它会破坏我的网格:

grid: [row1-start] 'header header header header header' auto [row1-end]
        [row2-start] 'menu content content content content' auto [row2-end]
        [row3-start] 'footer footer footer footer footer' auto [row3-end] / repeat(5, 1fr);

我在 grid-template-columns 属性中使用函数没有问题,当我想在 grid 属性中使用它时出现问题。

最佳答案

根据文档:

doc image

完整的 MDN 引用 here

关于css - 为什么我的重复函数在 css 的网格属性中不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48631375/

相关文章:

javascript - 将 div 放在其上时链接不起作用

javascript - Angular Material v15 深色/浅色主题

Java Swing GridLayout "Cell span"?

java - 如何在 JTabbedPane 中使用布局管理器?

CSS Grid - grid-gap 导致容器变得太小

html - img div 不适合 css 网格单元格

javascript - 具有网格布局的砌体画廊

html - CSS 中两个 div 容器的交替换行符

html - 动画悬停影响非兄弟元素

使用CSS网格的CSS网格框架