-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move Footer To The Bottom #16
Comments
First, you are right, the linked solution is not working under every circumstance. A (more) solid solution would be a creation with flex box. The question is, do we really want to fix the footer ad the end? The specification points out, that there must be no classical "end of page footer" (https://html.spec.whatwg.org/multipage/sections.html#the-footer-element). But according to the most use cases (for example other css frameworks), the footer is sticked to the bottom. I see three ways:
|
How about body { display: grid; min-height: 100vh; }
body > footer { align-self: end; } This seems to have all desired properties. However, I am not sure whether |
From my understanding, grid is for a different use case. But to be honest: We can use it like that - it's quite a simple solution and grid is supported of almost 92% of every browser. In the case grid is used, I suggest adding the ms-prefix for a wider support. The question is, should classless ship a default sticky footer or not. I find no reason to say no. Any further thoughts on that? |
Doing this vertically centered my header {
display: contents;
} |
For desktop, either sticky or non-sticky is OK. But for mobile, sticky footer makes so much sense. That is just my own personal and humble opinion. No statistic/data to back me up. P/S: this CSS library rocks! |
On pages with little content, the footer ist not a real footer, just an element in the middle of the screen with
margin-top: 10rem
.This codepen offers a solution to make it a real footer: https://codepen.io/cbracco/pen/kQmVGM (Not my code, btw. thx to the maker.)
It doesn't work as general solution, because big footers need a bigger padding-bottom for the body. But still, maybe we can find something to make the footer always a real footer?
(I am not a css expert, that's why I love this project so much ;) )
The text was updated successfully, but these errors were encountered: