问题
在一个fixed布局里有一个div超出滚动,但是top和bottom只有一个起作用(互斥),在如下代码
<div class='dialog'>
<div class='dialog-cover-layer'></div>
<div class="dialog-content">
<li>...</li>
</div>
</div>
.dialog {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 100;
}
.dialog-cover-layer {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0.3;
background: #000000;
}
.dialog-content {
width: 500px;
height: 1000px;
background: #fff;
position: absolute;
top: 56px;
bottom: 59px;
left: 50%;
transform: translate(-50%);
overflow-y: auto;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…