html - 为什么我的页面不可滚动?

标签 html css scrollable

所以我制作了一些使用以下 css 代码的页面:

html { overflow-y: scroll; }
    ul.navbar {
    list-style-type: none;
    position: fixed;
    top: 00px;
    left: 00px;
    width: 200px;
    height: 700px; 

    background-image:url('/images/B_left-background.png');
}

ul.header {
    position: fixed;
    top: -20px;
    left: 240px;
    height: 100px;
    width:700px;
    background-image:url('/images/B_left-top.png');
}

body {

    position: fixed;
    top: 100px;
    left: 300px;

    font-family: Georgia, "Times New Roman",
        Times, serif;

    background-color: #D6E9B4;
}
div.scrollableContainer {
    background: none repeat scroll 0 0 ;
    border: 1px solid #999999;
    height: 400px;
    margin: 40px;
    overflow: auto;
    width: 800px;
}
h1 {font-family: Helvetica, Geneva, Arial,
        SunSans-Regular, sans-serif }
ul.navbar a {text-decoration: none }

a.send{
    color: black;
    background-image:url('/images/send-message-bt.png');
    position:fixed;
    top:200px;
    left:0px;
    height:80px;
    width:290px;
}

a.token{
    color: black;
    background-image:url('/images/token-ID-bt.png');
    position:fixed;
    top:300px;
    left:0px;
    height:80px;
    width:290px;
}

a.history{
    color: black;
    background-image:url('/images/history-bt.png');
    position:fixed;
    top:400px;
    left:0px;
    height:80px;
    width:290px;
}

a.comp{
    background-image:url('/images/competition-bt.png');
    position:fixed;
    top:500px;
    left:0px;
    height:80px;
    width:290px;
}

a.out{
    background-image:url('/images/B_log-out-bt.png');
    position:fixed;
    top:600px;
    left:50px;
    height:60px;
    width:160px;
}

我想让整个页面都可以滚动,这样如果使用低分辨率设备的人仍然可以向下滚动。 如您所见,我输入了: html { 溢出-y: 滚动; } 但这没有帮助。

有什么办法可以解决这个问题吗?跟我设置固定高度有关系吗?

最佳答案

试试这个:

html { overflow-y: scroll; }
body { position: absolute; }

或者这个:

html { overflow-y: scroll; overflow-x:hidden; }
body { position: absolute; }

关于html - 为什么我的页面不可滚动?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12575251/

相关文章:

html - IE 7 中的设计问题

html - 隐藏的替代方案,以便该站点不像它仍然存在一样?

javascript - 通过 jQuery 显示/隐藏 <li>

Android - 主屏幕小部件中的可滚动 ListView

javascript - Skrollr 和相对模式无法工作

html - 在html中变量前的点表示什么?

css - 如何正确对齐在特定位置调整大小的内容

javascript - 禁用 HTML 中表单的所有元素(提交按钮除外)?

javascript - 如何在随幻灯片放映而变化的 div 中添加 div

c# - 如何在 ScrollableControl 上绘制不可滚动的元素