【发布时间】:2017-04-07 14:53:37
【问题描述】:
感谢overflow-y: auto;,当滚动条出现在 div 上时,我遇到了问题。
当右侧的 div #bb 有一个滚动条(在其中添加更多行以查看它发生)时,滚动条位于 #help div 上方。 如何让#help div 向左移动,以免被滚动条覆盖?
html,
body {
overflow: hidden;
height: 100%;
}
* {
margin: 0;
padding: 0;
}
#aa {
position: fixed;
top: 0;
left: 0;
width: 50%;
height: 100%;
overflow-x: hidden;
overflow-y: auto;
}
#bb {
position: fixed;
top: 0;
left: 50%;
width: 50%;
height: 100%;
background-color: blue;
overflow-x: hidden;
overflow-y: auto;
}
#help {
position: fixed;
top: 0;
right: 0;
background-color: green;
}
<div id="aa" contenteditable>a
<br>few
<br>lines
</div>
<div id="bb" contenteditable>please add more
<br>lines here to make
<br>the scrollbar appear!</div>
<div id="help">?</div>
【问题讨论】: