Design comparison
Solution retrospective
I did have some difficulties on align text under QRcode
Community feedback
- @HassiaiPosted over 1 year ago
Ther is no need for <div class="bg_blue">
<div class="bg_white"> in the html and their styling in the css.Give the body a background-color of hsl(212, 45%, 89%);.
There is no need to style .qr-code
For a responsive content,
- Give the main a fixed max-width value, a padding value for all the sides
max-width: 320px which is 20rem/em padding:16px which is 1rem/em
, a background-color of white and a border-radius value, the rest are not needed - Give the img a max-width of 100% and a border-radius value, the rest are not needed.
To center the main on the page using flexbox or grid,
- USING FLEXBOX: add min-height:100vh; display: flex; align-items: center: justify-content: center; to the body
body{ min-height: 100vh; display: flex; align-items: center; justify-content: center; }
- USING GRID: add min-height:100vh; display: grid place-items: center to the body
body{ min-height: 100vh; display: grid; place-items: center; }
Use relative units like rem or em as unit for the padding, margin, width values and preferably rem for the font-size values, instead of using px which is an absolute unit. For more on CSS units Click here and here
Hope am helpful.
Well done for completing this challenge. HAPPY CODING
Marked as helpful0 - Give the main a fixed max-width value, a padding value for all the sides
- @rinsterPosted over 1 year ago
Hi! Great job on this! The text alignment looks great. A couple of things:
It looks like the image wasn't uploaded to your host. Once that's uploaded, the image should show :)
A small adjustment to your css makes the QR centered on mobile and tablet:
div.bg_blue{ display: flex; justify-content: center; align-items: center; background-color: hsl(212, 45%, 89%); /* width: 1440px; */ height: 100vh; margin: 150px auto; }
Marked as helpful0 - @peanutbutterjllyPosted over 1 year ago
Hey @GrdevPro 👋,
one suggestion I have is for your div with a class of bg_blue, I'd put a
width: 100vw;
andheight: 100vh;
andmargin: 0;
- that should help make your background cover the whole page and center things nicely.not sure why your image isn't showing up, it looks like its pointed to the right place 🤔
good job on your submission, keep up the good work!
Marked as helpful0
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