Design comparison
Solution retrospective
I have a problem with footer! I did set "height:100vh;" and "display: flex;" "flex direction: column", but in Chrome when I check in inspect, on a larger screen, the footer is not stick at the bottom. can anyone help me with that?
Community feedback
- @josh76543210Posted about 1 year ago
Hi @mohsenrostami2000,
Good job on your solution. Looks great!
An easy way to make the footer stick to the bottom of your page on larger screens is to set a
margin-top: auto;
on the footer:footer { margin-top: auto; }
This works because you have are using flex-box for the body in the media query. If you also want the footer to stick to the bottom on smaller screens too then you have to use flex-box for all screen sizes:
body { display: flex; flex-direction: column; }
Hope this is helpful for you.
Happy Coding!
Marked as helpful1
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord