[英]How to make horizontal and vertical scrolling appear in browser? Overflow: auto; doesn't work
I know I can put the styles below in a CSS file, but that's for later. 我知道我可以将样式放在CSS文件中,但这供以后使用。
Could you help with making a scrollbar appear if there's any content (red) in the center
portion of fixed/variable width? 如果固定/可变宽度的center
部分中有任何内容(红色),是否可以帮助使滚动条显示? There are situations where the User's screen might be smaller than the content, but strangely no scrollbar appears. 在某些情况下,用户的屏幕可能比内容小,但奇怪的是没有滚动条出现。
<html>
<body>
<div id="header" style="background: #555;margin: 0px; padding 0px; position: fixed; top: 0px; left: 0px; width: 100%;min-width: 900px; height: 50px;overflow: auto;">
</div>
<div id="menu" style="background: #444;margin: 0px; padding 0px; position: fixed; top: 50px; left: 0px; width: 200px; height: 100%;overflow: auto;">
</div>
<div id="center" style="background: #666;margin: 0px; padding 0px; position: fixed; top: 50px; left: 200px; width: 100%;min-width: 900px; height: 500px;overflow: auto;">
<div style="width: 600px; height: 300px; background: red;overflow: auto;">
</div>
</div>
<div id="footer" style="background: #777;margin: 0px; padding 0px; position: fixed; bottom: 0px; right: 0px; width: 100%;min-width: 900px; height: 50px;overflow: auto;">
</div>
</body>
</html>
The reason to why your scrollbar is not showing is due to the position fixed on the #center div. 无法显示滚动条的原因是由于固定在#center div上的位置。
Heres a fiddle on what i believe you are after: http://jsfiddle.net/qgeLp1jn/ 关于我相信您的追随者,这里有一个小提琴: http : //jsfiddle.net/qgeLp1jn/
In the #content div, change the width of it to make the scroll bars to appear 在#content div中,更改其宽度以使滚动条显示
#content {
width: 500px;
height: 300px;
background: red;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.