Design comparison
Solution retrospective
What did you find difficult while building the project? Which areas of your code are you unsure of? Do you have any questions about best practices?
Community feedback
- @correlucasPosted about 2 years ago
👾Hello @MXalman, Congratulations on completing this challenge!
Great code and great solution! I’ve few suggestions for you that you can consider adding to your code:
Fix the alignment. The best way make this alignment is by using
FLEXBOX
. The first step, is to addmin-height: 100vh
to make the body height size becomes 100% of the viewport height, this way you make sure the container will be aligned vertically since thebody
will display ever 100% of the screen height. After that add two flex properties to make the alignmentdisplay: flex
/align-items: center;
/justify-content: center;
. If you're using the attribution you need to addflex-direction: column
to make the attribution stays under the QR Code component. See the code below:body { background: hsl(217, 54%, 11%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
REMOVE THE MARGIN:
.container { position: relative; width: 300px; height: 500px; /* margin: auto; */ background: hsl(216, 50%, 16%); border-radius: 10px; margin-top: 100px; box-shadow: 0 0 10px rgb(0 0 0 / 20%); }
✌️ I hope this helps you and 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