-2

I would like fix footer at the bottom of the page, I tried CSS

footer {
    position: absolute;
    bottom: 0;
}`

that one works just at the homepage of this website but not into topics just like this one

I'm trying to keep footers at the bottom of all web pages. The problem that I'm facing is that some web pages contains small amount of content, the footer can sometimes sit halfway up the page leaving a blank space underneath.

THIS IS MY CODE https://pastebin.com/EBPsZz6j

How do I solve this issue? Can someone fix my code plz?

Med Mod
  • 1
  • 2
  • From the first "already answered" link list: [this answer](https://stackoverflow.com/questions/42294/how-do-you-get-the-footer-to-stay-at-the-bottom-of-a-web-page#answer-34146411) is my favorite. – Andy Hoffman Feb 06 '19 at 19:53

1 Answers1

-4

You have to make sure that the layout div is as big as the screen.

becouse you have layoutHeight = screenHeight - footerHeight.

Add this css to the layout class and you should be good to go.

 min-height: 93.5vh;

I usually do think kind of thing with javascript.

alternative use Grid is much easer to maintain.

Alen.Toma
  • 4,684
  • 2
  • 14
  • 31
  • it's working man thanks you so much – Med Mod Feb 06 '19 at 19:50
  • Np man glad i could help, but for some reasen i got a down vote on this :) – Alen.Toma Feb 06 '19 at 19:53
  • @Alen.Toma You were down-voted because of the hard-coded number and lack of awareness of existing, superior solutions. In short, this answer is just one-off, bad advice that was sadly followed. It's cool that you're trying to help, but next time, look around for better solutions before concocting an answer like this. – Andy Hoffman Feb 06 '19 at 19:57
  • But he already have a whole project build, do you expect him to have to redo the whole design just for a better solution? and vh is not really hard-coding the value depends on the screan height. but i understand what you mean anyway :) – Alen.Toma Feb 06 '19 at 20:00
  • @Alen.Toma I believe some refactors are always worth the headache. – Andy Hoffman Feb 06 '19 at 20:31