繁体   English   中英

如何在浏览器中显示水平和垂直滚动? 溢出:自动; 不起作用

[英]How to make horizontal and vertical scrolling appear in browser? Overflow: auto; doesn't work

我知道我可以将样式放在CSS文件中,但这供以后使用。
如果固定/可变宽度的center部分中有任何内容(红色),是否可以帮助使滚动条显示? 在某些情况下,用户的屏幕可能比内容小,但奇怪的是没有滚动条出现。

<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>

无法显示滚动条的原因是由于固定在#center div上的位置。

关于我相信您的追随者,这里有一个小提琴: http : //jsfiddle.net/qgeLp1jn/

#content div中,更改其宽度以使滚动条显示

#content {
    width: 500px;
    height: 300px;
    background: red;
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM