Simple QR Code Component with HTML and CSS
Design comparison
Community feedback
- @HassiaiPosted almost 2 years ago
To center .wrapper on the page, add min-height:100vh; display: flex; align-items: center: justify-content: center; or min-height:100vh; display: grid place-items: center to the body.
To center .wrapper on the page using flexbox: body{ min-height: 100vh; display: flex; align-items: center; justify-content: center; }
To center .wrapper on the page using grid: body{ min-height: 100vh; display: grid; place-items: center; }
Hope am helpful.
Well done for completing this challenge. HAPPY CODING
2@KrzysztofRozbickiPosted almost 2 years ago@Hassiai Hello - thank you for reply and advice. I know the flex and grid method. I would love to know if it is better than the method i Used- which is simply absolute positioning with -50% translate.
0@HassiaiPosted almost 2 years ago@KrzysztofRozbicki it is a responsive method, its centers your content on the screen irrespective of the screen size.
Marked as helpful1@KrzysztofRozbickiPosted almost 2 years ago@Hassiai ok, will check that. I have noticed that my method is also responsive 100% because the position is % of screen but also have seen that it is kind of messed up when i am putting the mobile device horizontally. Will check the flex method for sure in the next challenge. Thanks.
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