gpt4 book ai didi

css - 滚动不适用于计算的高度

转载 作者:行者123 更新时间:2023-11-28 05:06:35 25 4
gpt4 key购买 nike

.menu {
width: 100%;
height: 100%;
position: fixed;
overflow-y:auto;
}

此 CSS 工作正常,但如果我将高度更改为计算高度,

height: calc(100% - 100px);

溢出隐藏,不滚动或自动。

有更好的主意吗?

最佳答案

在菜单周围添加一个 .menucontainer 并使用以下内容

.menucontainer {
width: 100%;
height: calc(100% - 100px);
position: fixed;
}
.menu {
width: 100%;
height: 100%;
position: static;
overflow-y:auto;
}

关于css - 滚动不适用于计算的高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39804665/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com