有两个块。一个块包含文本,另一个块只有一个稍微透明的背景。块可以相互重叠,并且由于一个块有背景,它与文本重叠,文本块不会滚动。我希望当块相交时,带有文本的块有一个滚动
.down-box {
position: fixed;
top: 0;
overflow: scroll;
}
.up-box {
position: fixed;
bottom: 0;
width: 100%;
background: green;
height: 50px;
opacity: 0.5;
}
<div class="wrapper">
<div class="down-box">
SCROLL<br>
SCROLL<br>
SCROLL<br>
SCROLL<br>
SCROLL<br>
SCROLL<br>
SCROLL<br>
SCROLL<br>
SCROLL<br>
</div>
<div class="up-box">
</div>
</div>


如果我理解正确..那么您想要制作块
.down-box并.up-box划分屏幕的整个高度,同时.up-box始终被按下到屏幕底部..如果是这样,那么有几个选项..
position: fixed;flexbox