防止CSS页脚滚动

时间:2013-02-13 21:08:44

标签: css footer

#bottom_fade {
            position: absolute;
            bottom: 0;
            width: 100%;
            background: url("bottom-fade.png");
            background-repeat:repeat-x;
            height: 400px;
            z-index: 2;
            }
        .categories {
            position: absolute;
            left: 50%;
            color:black;
            word-wrap: break-word;
            font-family: 15px 'Libre Baskerville', serif;
            margin-left: -200px;
            z-index: 1;
            }
        .categories td {
            width: 200px;
            }

您可能会看到上面代码here的结果。 尝试调整浏览器窗口的大小,以便您不得不滚动查看表格中的整个文本。

滚动时,您可能会看到#bottom_fade不会保持粘贴在页面底部,但会跟随您的滚动。我不希望这种情况发生:无论滚动条发生什么情况,我怎么能说bottom_fade始终保持连接到浏览器窗口的底部?

非常感谢!

1 个答案:

答案 0 :(得分:5)

更改

#bottom_fade {
        position: absolute;
}

#bottom_fade {
        position: fixed;
};

它应该像魅力一样。

(顺便说一下效果很好!)