Design comparison
Community feedback
- @correlucasPosted about 2 years ago
👾Hello Edgar, Congratulations on completing this challenge!
Your solution its almost done and I’ve some tips to help you to improve it:
The approach you've used to center this card vertically is not the best way, because using margins you don't have much control over the component when it scales. My suggestion is that you do this alignment with
flexbox
using the body as a reference for the container.The first thing you need to do is to remove the margins used to align it, then apply
min-height: 100vh
to the body to make the child (the card/container) align to its size that now will be displaying 100% of the viewport height and then give its alignment withdisplay: flex
andalign-items: center
/justify-items: center
.body { display: flex; min-height: 100vh; background-color: #d6e2f0; font-family: "Outfit", sans-serif; flex-direction: column; align-items: center; justify-content: center; }
REMOVE YOUR MARGIN:
.qr-container { /* margin: 200px auto; */ background-color: #ffffff; width: 250px; height: 400px; border-radius: 12px; }
✌️ I hope this helps you and happy coding!
Marked as helpful1@MerxibeaucoupPosted about 2 years ago@correlucas Thank you very much for your explanation , I fixed my code.. and it looks fine and makes sense now
1
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