
Design comparison
Solution retrospective
The mobile version looked good when resizing the screen on my laptop, but it broke when checking from my phone. The image was stretched over the entire container and the text became an overlay on the image. What I did was to put this code in mobile view:
.wrapper {
height: max(auto, 100vh);
}
It was initially set to height: 100vh
, so it was resizing to the viewport height of the phone instead of creating an overflow.
Is there a better way to align the container at the center of the screen while the footer is at the bottom? I'm using Grid to do it in this project, and I have used Flexbox combined with margin-top: auto
in the past.
Community feedback
- @x-147Posted 5 days ago
"Is there a better way to align the container at the center of the screen while the footer is at the bottom? I'm using Grid to do it in this project, and I have used Flexbox combined with margin-top: auto in the past."
hmm, not sure what you mean. another way to center .wrapper is with display: flex, flex-direction: column, justify-content: center, align-items: center, min-height: 100vh, quite similar to what you have now.
0
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