0

我第一次在我整理的网站上使用粘性页脚,但似乎没有按计划进行。似乎有一个大的空白区域,然后是一个黑色区域(这是我页脚的颜色)请参阅链接http://c-hall.the-word.com/assignment/whatwedo.php我需要页脚对接到最后一点内容的底部,在这种情况下,文本女巫尚未设置样式。请参阅下面的代码 - 感谢您的帮助 - Charley

CSS

/* sticky footer */
* {
margin: 0;
}
html, body {
height: 100%;
}
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -335px;
}
.footer, .push {
height: 335px;
background-color: #000;
}
#innerfooter {
width: 847px;
height: 335px;
position: relative;
background-image: url(../images/black_bar.png);
background-repeat: no-repeat;
text-align: left;
margin: 0 auto;
}
/* end sticky footer */
4

3 回答 3

1

试试这个大小,如果内容不够长,它会留在页面底部,如果内容到达它,它会支撑底部http://ryanfait.com/sticky-footer/

于 2011-04-05T10:48:53.563 回答
0

你总是会有这个差距,因为你的页脚的 位置静态的,所以它固定在浏览器的底部。这个白色的间隙是你的身体背景宽度未使用的空间。因此,通过减少页面宽度或您认为合适的任何其他方法来填充或消除它!关键是我没有给你一个精确的解决方案,但更重要的是理解你在做什么,而不仅仅是应用教程。

于 2011-04-05T13:10:55.417 回答
0

查看您的 html 结构(尤其是 .wrapper div。)。div 的位置是错误的。

并阅读此链接:http ://www.cssstickyfooter.com/

于 2011-04-05T10:49:05.870 回答