Search code examples
htmlcssbuttonfixed

Footer buttons fixed?


I have 3 buttons that I need to stay fixed in the lower right corner of the page.

Example.

But when I set position:fixed , it goes straight up to the top (which is also fixed).

How can I make them stay down there, yet when I scroll up to follow me?

Thank you!


Solution

  • Add position: fixed; bottom: 0; ,and remove the top:0;,the bottom property sets the bottom edge of an element.

    Try this code:

    DEMO

    #buton{text-align:right;
        height: 100px;
        width: 100%;
        z-index: 100;
        position: fixed;
        bottom: 0;
        }