不能向下滚动以查看页脚

时间:2014-03-11 17:04:23

标签: javascript css html5 css3

我是一名(荷兰语)第一年学习ICT和媒体设计的学生,我们正在使用HTML / CSS / JavaScript。

在为我自己创建一个使用javascript,html和css的页面时,我偶然发现了一些问题。

我无法向下滚动以在页面上看到我的页脚。 我很确定我对固定位置做错了但我似乎无法确切地知道究竟是什么。

希望你们能帮助我,明智的定位可能更错误。

提前谢谢。

http://athena.fhict.nl/users/i299291/WP21/index.html (学校的服务器)

2 个答案:

答案 0 :(得分:0)

您的页脚有一个固定的位置。它显示在您的内容背后。摆脱它,你应该能够向下滚动到你的页脚。

答案 1 :(得分:0)

您的页脚未显示,因为您正在使用不必要的使用位置。从您的CSS中删除所有position:fixedposition:absolute,然后页面将可滚动,您可以看到您的页脚。

这是更新的CSS;你可以看到所有的位置都被评论过,不需要使用它们。

#header {
    margin-left: auto;
    margin-right: auto;
    margin-top: 15px;
    position: relative; /* remove this line*/
    width: 100%;
}

#menubar {
    background-color: #2C2C2D;
    border: 1px solid #FFFFFF;
    height: 51px;
    line-height: 20px;
    margin: 261px auto 0; /* remove this line*/
    position: absolute; /* remove this line*/
    text-align: center;
    vertical-align: middle;
    width: 1280px;
}
#containerIndex {
    background-color: #FFFFFF;
    height: 530px;
    margin-top: 330px;
    opacity: 0.5;
    position: fixed; /* remove this line*/
    width: 1280px;
}
#footer {
    background-color: #C6C7C0;
    border: 1px solid #FFFFFF;
    height: 48px;
    line-height: 50px;
    margin: 880px auto 10px;/* remove this line*/
    position: fixed;/* remove this line*/
    text-align: center;
    vertical-align: middle;
    width: 1280px;
}
相关问题