Order Summary Card using HTML CSS Flexbox
Design comparison
Solution retrospective
How could I have gotten the hero-image to center properly @ 375px (mobile)?
I initially wanted to set the card width to 375px (mobile), but when I noticed that the hero-image didn't fix well in the center.
Community feedback
- @correlucasPosted about 2 years ago
πΎHello Godwin, congratulations for your new solution!
Answering your question:To make this alignment, first of all remove all margins used to align and do this enterily with flex, by adding
min-height: 100vh
to thebody
to make the body display 100% of the viewport height (this makes the container align to the height size thats now 100% of the screen height) size anddisplay: flex
eflex-direction: column
to align the child element (the container) vertically using the body as reference.π I hope this helps you and happy coding!
Marked as helpful0@godwin-okechukwuPosted about 2 years ago@correlucas, thank you so much. I never thought along that line. I'm glad you reached out π
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