Keep div in position after user scrolls page

16,298
position: fixed;

This should do it

Share:
16,298
user852974
Author by

user852974

Updated on June 05, 2022

Comments

  • user852974
    user852974 almost 2 years
    #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;
    }
    

    This div maintains a position 20x20 px from the bottom right corner of the page. But my site contains an "endless page" pagination feature and when scroll bars appear on the browser window because the content increases, the div does not maintain its position in the bottom right hand corner but rather moves up the page. How can I get this div to stay in the bottom right corner even when the user scrolls or when scroll bars appear? Thanks