我目前正在这个网站上工作,我希望页脚是屏幕的 100%(宽度),但无论我做什么,它都拒绝响应。我检查了身份证是否有重复,但我什么也没看到。CSS代码如下所示:
#footer {
width: 100%;
clear: both;
height: 400px;
background-color: #293D61;
}
您的页脚是#rack 内的嵌套 div。在 100% 时,您的页脚将仅与您的外部/父 div 一样宽。您需要将其移出父 div 并使其成为兄弟
检查您的页脚是否在其他 div 内...?如果是这样,那么它将不是整页长度....
尝试这样做,
#footer {
position: absolute;
bottom: 0;
width: 100%;
clear: both;
height: 400px;
background-color: #293D61;
}