我如何才能在 div 之外滚动,并且在我的情况下,动作将被分配给具有隐藏溢出的固定 div 是#scrollable_content。
HTML
<div id="container">
<div id="header">Header</div>
<div id="scrollable_content">
Very long content<br />
Very long content<br />
...
Very long content<br />
Very long content<br />
</div>
<div id="footer">Footer</div>
</p>
CSS
html, body {
height:100%;
margin: 0;
padding: 0;
overflow: hidden;
}
div { margin: 0; padding: 0;}
div#header{position:absolute;top:0;width:100%;border:1px solid black;}
div#footer{position:absolute; bottom:0; width:100%; border:1px solid black;}
div#scrollable_content {
height: 300px;
overflow-y:auto;
position: static;
border: 1px solid green;
margin: 150px;
}
</p>