Forum Moderators: not2easy

Message Too Old, No Replies

Centrally aligned page with sticky footer.

Centrally aligned page with sticky footer.

         

ChrisBolton

2:28 pm on Mar 18, 2008 (gmt 0)

10+ Year Member



Good afternoon all!

I'm looking to centrally align a web page and have the footer stick to the bottom of the page. I seem to be able to do one or the other but not both together. The wrapper is fixed with and I would like the footer to be 100% width.

This is what I have right now:

<html>
<body>
<div id="wrapper"></div>
<div id="footer</div>
</body>
</html>

html, body {
height: 100%;
position: absolute;
text-align: center;
}
html>body {
height: auto;
min-height: 100%;
}
#wrapper {
position: relative;
margin: 0;
min-height: 100%;
height: 100%;
voice-family: "\"}\"";
voice-family: inherit;
height: auto;
width: 840px;
text-align: left;
padding-bottom: 140px;
}
#footer {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 130px;
text-align: left;
}

Any help in fixing this would be gladly appreciated.

Kind Regards
Chris.

ChrisBolton

2:42 pm on Mar 18, 2008 (gmt 0)

10+ Year Member



I just changed 'margin: 0;' to 'margin: 0 auto;' in the wrapper and it seems to work fine!

Happy Days!