What is the modern technology for fitting the footer to the bottom of the browser when the content is short?

I found many places that mention Ryan Feith's technique: http://ryanfait.com/sticky-footer/

And also found this: http://matthewjamestaylor.com/blog/keeping-footers-at-the-bottom-of-the-page

But they both seem outdated and hacky, even if the code really checks. Is there something simpler that works in modern browsers?

+4
source share
2 answers

This is a cleaner way to make a sticky footer where there is no need to have extra wrappers and works in all browsers, including IE8.

html { position: relative; min-height: 100%; } body { margin: 0 0 110px; /* bottom = footer height + margin of the footer */ } footer { position: absolute; left: 0; bottom: 0; margin-top:10px; height: 100px; width: 100%; } 
+1
source

Easy! Use position:absolute; and bottom:0;

0
source

Source: https://habr.com/ru/post/1480993/


All Articles