0

我目前正在这个网站上工作,我希望页脚是屏幕的 100%(宽度),但无论我做什么,它都拒绝响应。我检查了身份证是否有重复,但我什么也没看到。CSS代码如下所示:

#footer {
    width: 100%;
    clear: both;
    height: 400px;
    background-color: #293D61;
}
4

3 回答 3

4

您的页脚是#rack 内的嵌套 div。在 100% 时,您的页脚将仅与您的外部/父 div 一样宽。您需要将其移出父 div 并使其成为兄弟

于 2012-07-02T19:39:37.770 回答
0

检查您的页脚是否在其他 div 内...?如果是这样,那么它将不是整页长度....

于 2012-08-15T05:28:55.373 回答
0

尝试这样做,

#footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    clear: both;
    height: 400px;
    background-color: #293D61;
}
于 2012-07-02T19:36:23.400 回答