I want my footer to be at the bottom of the page, even when there are not enough elements on the page to push it down. I tried position: fixed
with a bottom: 0
but that makes it stay there when there are elements filling the page.
How can I make the footer be at the bottom of all the elements when the page is full and at the bottom of the screen when the page is not?
2
Answers
make a div between your nav and footer and then set the height of div to 100vh or screen so it work.
CSS
HTML
"100vh" is the full height of screen
You can make clone as placeholder
like:
Make onscreenfooter fixed position
and copy its height to placeholder
clientHeight includes padding.
or
offsetHeight includes padding, scrollBar and borders.