My website has varaible content length, and this sometime means that the footer does not site at the bottom of the page, is there a way to make the footer fill whatever space is left?
Asked
Active
Viewed 1.2k times
3 Answers
1
Take a look at excellent post at CSS-Tricks.Com:

Sarfraz
- 377,238
- 77
- 533
- 578
-
links broken on both demo and the page in the link. – kiwicomb123 Mar 07 '18 at 01:31
1
css
#footer {
position:fixed !important;
bottom:0;
}
This should do it. You can add a padding on your content wrapper that have the height of your footer + 50px or something like that, for spacing between content and footer. The footer will be on top of your content else.

EastDane
- 137
- 1
- 10
0
There are multiple approaches to this problem. One is to have
html, body { height:100%; }
in your CSS. This, however, might create issues on pages that scroll vertically. For complex cases you will have to resort to JavaScript onResize coding.
See if this helps:
How do I force a DIV block to extend to the bottom of a page even if it has no content?