How do you get the footer to stay at the bottom of a Web page?
Sticky footer on Google:
Have a <div>
with class="wrapper"
contain everything. After the wrapper </div>
, place thepush div
, then the footer div
.
* {
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 */
}