为什么我的页面无法滚动? [英] Why is my page not scrollable?

查看:1923
本文介绍了为什么我的页面无法滚动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我制作了一些使用以下CSS代码的页面:

So I have made a few pages that use the following css code:

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 {overflow-y:滚动; } 但这无济于事.

I would like to make the whole page scrollable, so that if someone on a low-resolution device can still scroll down. As you can see I put in the: html { overflow-y: scroll; } But this does not help.

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

Is there any way I can fix this? Does it have something to do with me setting the fixed-heights?

推荐答案

尝试一下:

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

或者这个:

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

这篇关于为什么我的页面无法滚动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆