My site is structured roughly like this:
-----------------
header
-----------------
|
|
side| main
|
|
-----------------
footer
I’m trying to get my “main” div to take all of the remaining height on the screen (and resize during window resizing), so that “footer” is always automatically pushed to the bottom of the screen (appearing to be stuck at the bottom of the screen).
However, I want this only to happen if the content of the “main” div isn’t already at that height or even larger. I’m using jQuery but I have a hard time calculating this correctly. Can someone give me a pointer in the right direction?
The method is called sticky footer, and you don’t need jQuery for that. You can use CSS:
[See it in action]