psychotik
psychotik

Reputation: 39019

Set position of page footer using CSS/JS

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?

Upvotes: 1

Views: 800

Answers (1)

Michael Cheng
Michael Cheng

Reputation: 10451

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

Sticky Footer help!

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:

How do you get the footer to stay at the bottom of a Web page?

Upvotes: 2

Related Questions