I'm having a hard time with a simple css snippet for footer text. The footer text must always be at the end of the page and the end of the screen whatever comes later.
A:
* {
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 */
}
/*
Sticky Footer by Ryan Fait
http://ryanfait.com/
*/
Jakob Stoeck
2009-10-14 11:10:15
This would position it at the bottom of the viewport. If the page was longer it would not be at the bottom of the page (which the question specific).
David Dorward
2009-10-14 11:44:03
It would, if the body tag has position: relative;
gnud
2009-10-14 12:01:12
@David yes it would - did you try it? I've used it on several projects. See http://www.w3schools.com/CSS/pr_pos_bottom.asp
ANaimi
2009-10-14 18:54:47
A:
For a working example which you could pick apart I had previously done this exact same thing for a client of ours:
cballou
2009-10-14 11:56:21