0

I'd like to know how to stick the footer to the bottom, even if the page doesn't have content. I searched solutions before making this post, but no real solutions. The newbie solution could be to put margin-top but that could make a full page look ugly. Btw, thanks in advance and that's my code.

<footer class"footer">
    //content
</footer>

.footer {
    position: relative;
}
Asez
  • 159
  • 1
  • 3
  • 13

1 Answers1

0

If your page has no content, you can fix the footer to the bottom of the screen.

<footer class"footer">
    //content
</footer>


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

jsfiddle: https://jsfiddle.net/1La17zsr/

Mithu Mondal
  • 265
  • 2
  • 11
  • Thanks! But there is a problem, if the page hasn't content, it's ok, the footer is fixed to the bottom. But when the page is full, the footer is about 250px from the top. – Asez Jan 29 '18 at 20:11