
Frontend mentor QR code challenge
Design comparison
Community feedback
- @SoniBasantPosted about 2 years ago
Make it larger, center it using flex, convert h2 into h1 then bring it size down.
All other are good. Good Luck. : )
Marked as helpful0 - @HassiaiPosted about 2 years ago
Replace <div id="qr-box"> with the main tag, <h2> with <h1> to fix the accessibility issues. click here for more on web-accessibility and semantic html
Add the alt attribute
alt=" "
to the img tag and give it a value to fix the error issue. The value of the alt attribute is the description of the image. For decorative images like icons, there is no need to give it an alt value, for more on alt attribute Click here.there is no need to give the body a margin value.
Give h1 and p the same font-size of 15px which is 0.9375rem, text-align: center, the same margin-left, margin-right and margin-top values. Give p a margin bottom value.
For a responsive content which wont require a media query for this challenge:
- there is no need for the height in #qr-box and increase the max-width and padding value for it to be equivalent to the design,
max-width:320px padding:16px
- Give the img a max-width of 100% and a border-radius , the rest are not needed.
To center #qr-box on the page using flexbox or grid instead of margin,
- 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
Hope am helpful.
Well done for completing this challenge. HAPPY CODING
Marked as helpful0 - there is no need for the height in #qr-box and increase the max-width and padding value for it to be equivalent to the design,
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