页面高度为100%。嵌套的div溢出-y不起作用

问题描述 投票:0回答:1

我尝试使用flex制作100%高的页面。然后几项,看起来都很好

enter image description here

然后我在列表中添加更多项,div_content高度超出底部浏览器并显示为页面滚动

enter image description here

如果我添加overflow-y:滚动至项目列表,则无济于事……该如何解决?

enter image description here

SANDBOX:https://liveweave.com/uwiKYp

html css flexbox
1个回答
0
投票

[最有可能,您只需将100%更改为100vh,问题就会得到解决,通常是由于父级高度属性不同而发生的。

此外,此问题在这里得到广泛解释:Why doesn't height: 100% work to expand divs to the screen height?

© www.soinside.com 2019 - 2024. All rights reserved.