【发布时间】:2018-03-23 19:00:13
【问题描述】:
我有以下 CSS 网格:
.grid-3x4 {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: 1fr 1fr 1fr 1fr;
grid-template-areas:
'a b c '
'd e f'
'g h i'
'l m n';
}
尽管模板区域的内容不同,但我希望网格具有 100vh 的固定高度。 我尝试插入:
max-height : 100vh;
到 .grid-3x4 类但不工作。 我还尝试将网格包装在另一个类中,在包含类上设置最大高度,但没有运气。我该怎么做?
【问题讨论】:
-
好了
=它永远不会在任何事情上工作...... -
@cbroe 已修复,抱歉
-
你知道了吗