I have made a small web page for my university project. But after some testing i noticed that if there isn't enough content in the <main> section of <body> then <footer> will appear after the end of content despite there being some empty space down bellow. I tried to fix this using css properties bottom: 0; margin-top: auto. But it had no effect at all. After inspecting some popular web sites i discovered that a lot of them definitely used JavaScript to place some sort of adjustable margin if there wasn't enough content. Is it even possible to do that without using JavaScript?
Asked
Active
Viewed 16 times
0
-
Where do you want the footer to be? At the end of all content as long as that content (plus any header? plus footer) fllls the viewport, otherwise at the bottom of the screen? – A Haworth Dec 01 '21 at 21:32