0

我为我的网站制作了一个粘性页脚,但它不像我想要的那样。我希望它完全位于底部,始终取决于内容的长度。相反,它总是按原样出现在屏幕上。谁能帮我 ?

本站

页脚CSS:

#footer{
position: fixed;
bottom: 0;
z-index: 1;
width: 100%;
height: 50px;
clear: both;
background-image: url("../images/footer_pattern.png");

}

4

2 回答 2

1
#footer{
width: 100%;
height: 50px;
clear: both;
background-image: url("../images/footer_pattern.png");
display: block;
margin-top: 0px;
//if contains children add overflow:hidden;
}
于 2012-08-07T14:38:17.853 回答
0

你的问题有点含糊,但如果我理解正确,我认为你正在寻找的是位置:相对。

position: relative;
bottom: 10px;

它的作用是在元素和下一个相对父元素之间添加指定数量的空间(10px)。祝你好运!

于 2012-08-07T14:29:13.177 回答