当没有足够的内容时,页脚不会粘到页面的底部,例如,当某人搜索到没有结果时,页脚显示在中间而不是停留在页面的底部。页脚不会粘到底部
我读过所有其他帖子,但它似乎代码是不同的我的。
这是页脚CSS代码:
.footer {
padding: 10px 0;
}
#footercontainer {
clear:both;
width:100%;
position:relative;
height:250px;
bottom:0;
}
#footer {
clear:both;
padding-top:0px;
width:100%;
position:absolute;
bottom:0;
left:0;
}
#footer img {
border:none;
text-align:center;
}
#footermiddlecontent {
width:973px;
margin-left:auto;
margin-right:auto;
}
#footermiddlecontent p {
font-size:14px;
}
#footermiddlecontent a {
font-size:12px;
font-family:arial;
}
#footerbottom p {
text-align:center;
padding-top:5px;
font-size:12px;
font-family:arial;
}
#footerbottom a {
font-family:arial;
}
请尝试http://stackoverflow.com/questions/7956787/footer-wont-stick-to-the-bottom-help 也http://stackoverflow.com/questions/1488565/how-tostick -a-footer-to-bottom-in-css 我建议在大多数情况下避免使用javascript。请发布代码的骨架以获得更全面的答案。 – kush