【发布时间】:2012-09-10 03:29:51
【问题描述】:
当没有足够的内容时,我的页脚不会粘在页面底部,例如,当有人搜索没有结果时,页脚会显示在屏幕中间而不是停留在页面底部。
我已阅读所有其他帖子,但代码似乎与我的不同。
这是页脚 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;
}
【问题讨论】:
-
请尝试stackoverflow.com/questions/7956787/… 和stackoverflow.com/questions/1488565/… 我建议在大多数情况下避免使用javascript。请发布您的代码框架以获得更完整的答案。