【发布时间】:2018-08-03 14:48:45
【问题描述】:
我有一个wraper div 有一些孩子。由于所有孩子的高度加起来大于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>
【问题讨论】: