Design comparison
SolutionDesign
Solution retrospective
I had a hard time with this one. I still seem to be struggling with vertical centering. I used margin-top, but it seems like there may be a better way. Can anyone help?
Community feedback
- @talisong-cardosoPosted over 2 years ago
Try this
<div class='container> <div class='qr-code'> your code... {.qr-image; .info} </div> </div>
.container { min-height: 100vh; display: flex; justify-content: center; align-items: center; }
.qr-code { */ your code that was previously in the .container. for example: */ background-color: hsl(0, 0%, 100%); height: 500px; width: 320px; border-radius: 10px; padding-top: 10px; }
0 - @jmr-smithPosted over 2 years ago
If you're talking about centering the entire card vertically, try creating a container component around your entire card and setting it to display: flex; with justify-content: center; and align-items: center;. Just make sure that the height of the container is 100%. - https://stackoverflow.com/questions/19026884/flexbox-center-horizontally-and-vertically
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