我在一个Less文件中有以下CSS规则:
.container {
min-height: calc(100vh - 150px);
}
这根本不起作用。我想让容器占据整个窗口高度,并减去头部和底部固定高度。
我该怎么做?
我在一个Less文件中有以下CSS规则:
.container {
min-height: calc(100vh - 150px);
}
这根本不起作用。我想让容器占据整个窗口高度,并减去头部和底部固定高度。
我该怎么做?
确实有效。问题在于我的less编译器。它被编译成了:
.container {
min-height: calc(-51vh);
}
通过以下 less 代码进行修复:
.container {
min-height: calc(~"100vh - 150px");
}
calc(~"100vh - @{navbar-height}")
。 - Julián Landerrechemax-height: calc(100vh - 150px)
。干杯! - Elharony