gpt4 book ai didi

html - Flexbox overflow-y : scroll not working in IE, Edge 和 Firefox

转载 作者:行者123 更新时间:2023-11-28 15:08:23 26 4
gpt4 key购买 nike

<分区>

我有一个 wraper div,它有一些 child 。由于所有子项的总高度大于 wrapper div 的高度,我希望父项能够滚动。

以下解决方案适用于 Chrome,但不适用于 Edge、IE 和 Firefox。我尝试了不同的方法,但我的解决方案似乎都不起作用。有没有人有任何适用于不同浏览器的解决方案?

#wrapper {
display: flex;
flex-direction: column-reverse;
background-color: green;
width: 300px;
height: 300px;
overflow-y: scroll;
}

.inner {
background-color: red;
height: 100px;
width: 100px;
margin-top: 10px;
min-height: 100px;
}
<div id="wrapper">
<div class="inner">hello</div>
<div class="inner">hello</div>
<div class="inner">hello</div>
<div class="inner">hello</div>
<div class="inner">hello</div>
<div class="inner">hello</div>
</div>

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