固定位置页脚随页面滚动而移动

时间:2012-10-30 13:30:04

标签: jquery scroll footer offset sticky

我有一个单页wordpress网站,其中包含向下滚动页面的菜单项。目前我的页脚位于页面的底部,但我希望它从顶部向下约1500px,当您滚动浏览它时,它会粘在浏览器窗口的底部。有人可以给我一些关于这个的指导吗?

网站目前在这里举行: Website Link

谢谢, 萨姆

2 个答案:

答案 0 :(得分:1)

1)将position: fixed;添加到#custom_footer;

2)向margin-bottom添加一个大的#csp3_content

这对我有用:

#custom_footer {
  position: fixed;
  bottom: 0;
}

#csp3_content {
  margin-bottom: 1000px;
}

答案 1 :(得分:1)

您是否尝试将样式top:1500px;position: fixed添加到#footer

#footer {
 margin: 150px 0 0 0;
width: 960px;
float: left;
top: 1500px;
position: fixed;
color: white;
}
相关问题