4

我需要一些快速帮助。我的页脚根本不会在站点的末尾出现。它在包装内等等。我根本找不到错误(长时间查看相同的代码)

我已将代码放入 Jsfiddle:http: //jsfiddle.net/heNuB/

不要介意其他代码,我已经用 background-color:black; 标记了页脚。所以你可以看到页脚试图去哪里。它试图进入我的 3 个盒子的“后面”。

希望你们中的一些人有时间研究它。我知道这是一个小问题。

祝大家有美好的一天!:)

4

4 回答 4

5

在页脚之前放置一个清除 div,它应该到底部。

<div style="clear: both"></div>

您的浮动框正在推过主包装器。

供参考:http ://www.quirksmode.org/css/clearing.html

于 2012-10-17T11:39:28.847 回答
1

采用clear: both;

footer
{
    font-size:small;
    text-align:center;
    height:50px;
    background-color:black;
    clear: both;

}

演示:http: //jsfiddle.net/Sudjy/

于 2012-10-17T11:43:35.300 回答
1

或者您可以只增加 margin-top 属性,这是我的代码:

  .footer {
background-color: #717164;
margin-top: 50px;  
border: 1px solid black;
float: left;
width:99%;
height: 10%;
position: fixed;
clear: both;
margin-top: 565px;
}

.footer 是因为我给了我的页脚 div 一类页脚,以防你不知道。

于 2013-06-11T22:35:42.883 回答
0

为什么不给页脚一个 margin-top 属性 .footer { margin-top: 50px; //或什么 } 它应该下降。

于 2012-10-17T11:42:35.767 回答