这是JSFiddle:
https://jsfiddle.net/stgeqjoL/
html,
body,
#container {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
我有一个侧面板,它有很多div,可以在选中时执行某些操作。
正文设置为隐藏溢出,这使得侧面板也隐藏了溢出,但我希望它能够滚动。
我需要改变什么?
答案 0 :(得分:0)
您需要向height
添加#sidebar
值以及overflow: scroll
。
尝试:
#sidebar {
position: absolute;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.85);
width: 350px;
overflow: scroll;
height: 100vh;
}