This question already has an answer here:
Can anyone explain how to align a footer div to the bottom of the page. From the examples I've seen, they all show how to make the div stay visible at the bottom, no matter where you've scrolled the page. Although I don't want it like that. I want it fixed at the bottom of the page, so it doesn't move. Appreciate the help!
UPDATE
My original answer is from a long time ago, and the links are broken; updating it so that it continues to be useful.
I'm including updated solutions inline, as well as a working examples on JSFiddle. Note: I'm relying on a CSS reset, though I'm not including those styles inline. Refer to normalize.css
Solution 1 - margin offset
https://jsfiddle.net/UnsungHero97/ur20fndv/2/
HTML
CSS
Solution 2 - flexbox
https://jsfiddle.net/UnsungHero97/oqom5e5m/3/
HTML
CSS
Here's some links with more detailed explanations and different approaches:
ORIGINAL ANSWER
Is this what you mean?
http://ryanfait.com/sticky-footer/
This footer will stay at the bottom of the page permanently. This means that if the content is more than the height of the browser window, you will need to scroll down to see the footer... but if the content is less than the height of the browser window, the footer will stick to the bottom of the browser window instead of floating up in the middle of the page.
Let me know if you need help with the implementation. I hope this helps.
Your title and comments imply that you weren't looking for a sticky footer (stuck to the bottom of the window as content scrolls below it). I assume you were looking for a footer that would be forced to the bottom of the window if the content does not fill the window, and push down to the bottom of the content if the content exceeds the window boundary.
You can accomplish this with the following.
Source: How to keep footers at the bottom of the page
This will make the div fixed at the bottom of the page but in case the page is long it will only be visible when you scroll down.
The height and margin-top should be the same so that the footer doesnt show over the content.
Use
<div style="position:fixed;bottom:0;height:auto;margin-top:40px;width:100%;text-align:center">I am footer</div>
. Footer will not go upwardscheck this out, works on firefox and IE
I am a newbie and these methods are not working for me. However, I tried a margin-top property in css and simply added the value of content pixels +5.
Example: my content layout had a height of 1000px so I put a margin-top value of 1005px in the footer css which gave me a 5px border and a footer that sits delightfully at the bottom of my site.
Probably an amateur way of doing it, but EFFECTIVE!!!