Skip to content
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 bottom and make main full height with flexbox #370

Closed
DanielRuf opened this issue Dec 13, 2020 · 4 comments
Closed

Move footer to bottom and make main full height with flexbox #370

DanielRuf opened this issue Dec 13, 2020 · 4 comments
Assignees

Comments

@DanielRuf
Copy link

DanielRuf commented Dec 13, 2020

The pb7 trick is not that ideal. You can move the footer to the bottom with the following:

html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
}

See also https://css-tricks.com/couple-takes-sticky-footer/

@meghapsimatrix
Copy link

meghapsimatrix commented Jun 25, 2021

Hi where would I add this?

Here is the repository of the website that I am working on : https://github.com/meghapsimatrix/meta_sig_website
I am using the Ananke theme. I just noticed that the footer appears a bit above the bottom when I am using larger screens.

THANKS!

@DanielRuf
Copy link
Author

Hi @meghapsimatrix,

is it still relevant? Because at meghapsimatrix/meta_sig_website@3eb1e6f you remove the footer.

I've just added the CSS code from the comment (and removed the old one for the footer) instead of using Tailwind.

@meghapsimatrix
Copy link

Hi @DanielRuf yes, thank you! I was trying to get the sticky footer to work like you suggested in your comment but couldn't last night. And, I was just trying to see what the site looks like without the footer. Thank you for your suggestion to remove the old one.

@meghapsimatrix
Copy link

I fixed it thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants