Search code examples
cssfootersticky-footer

How do you create a bar at the bottom of the browser that is persistent?


What HTML/CSS is used to create a bar that fills the bottom of the browser and remains in place when the user scrolls? See envato.com for an idea of what I'm talking about.


Solution

  • I've used this method before and it seems to work just fine.

    http://ryanfait.com/sticky-footer/

    * {
        margin: 0;
    }
    html, body {
        height: 100%;
    }
    .wrapper {
        min-height: 100%;
        height: auto !important;
        height: 100%;
        margin: 0 auto -142px; /* the bottom margin is the negative value of the footer's height */
    }
    .footer, .push {
        height: 142px; /* .push must be the same height as .footer */
    }