用户滚动页面后将div保持在适当位置

use*_*974 10 html css scroll positioning

#div1 {
    background: #ffffff;
    padding: 6px;
    color:#333; 
    font:normal 10px Arial, Helvetica, sans-serif; 
    text-decoration: none; 
    text-transform: uppercase;
    position: absolute;
    bottom: 20px;
    right: 20px;
}
Run Code Online (Sandbox Code Playgroud)

此div保持距离页面右下角20x20像素的位置.但我的网站包含一个"无限页面"分页功能,当滚动条出现在浏览器窗口上因为内容增加时,div不会保持其在右下角的位置,而是向上移动页面.即使用户滚动或出现滚动条,如何让这个div保持在右下角?谢谢

War*_*ace 19

position: fixed;
Run Code Online (Sandbox Code Playgroud)

这应该做到这一点