views:

109

answers:

1

I've created a standard header, body, footer web page. I want to position the footer to be at the bottom of the viewable browser window when the body is smaller than the height of the window, but at the bottom of the page when the body exceeds the browser height.

Any suggestions on how I use CSS (preferably) or JS to accomplish this?

+1  A: 

What you're looking for is a css sticky footer. Similar questions are:

http://stackoverflow.com/questions/1448564/sticky-footer-help

http://stackoverflow.com/questions/1112082/problem-with-css-sticky-footer-implementation

There are a lot of different ways of accomplishing this. I personally use this: http://www.cssstickyfooter.com/

Edit: did some more searching and I think I found a duplicate so this should probably be closed:

http://stackoverflow.com/questions/42294/how-do-you-get-the-footer-to-stay-at-the-bottom-of-a-web-page

Michael Cheng