如何强制div总是出现在页面底部,并在滚动后保持在那里?

时间:2010-03-27 16:40:01

标签: javascript html css

几乎所有的主题,我是否需要使用javascript来实现这个pr也许css会很合适?此外,我需要该解决方案与IE6一起正常工作。

如果javascript只是解决方案,那么如何动画div来平滑地改变位置?

感谢您的帮助

2 个答案:

答案 0 :(得分:1)

像这样:

<div style="position: fixed;bottom: 0px;right:0px;">
    This would be on the buttom of the page regardless to scroll.
</div>

答案 1 :(得分:0)

您可以在CSS中使用calc()将其固定在页面底部。

Check out the CSS Hacks article explaining some of the use cases of calc().