QR code component using FlexBox and GridSystem
Design comparison
Solution retrospective
it was hard to get the layout right at first, but later on it got easier
Community feedback
- @MelvinAguilarPosted over 1 year ago
Hello there 👋. Good job on completing the challenge !
I have some suggestions about your code that might interest you.
HTML 🏷️:
- Use semantic elements such as
<main>
and<footer>
to improve accessibility and organization of your page.
CSS 🎨:
- Do not use
overflow: hidden
on the body element, this will prevent scrolling on some devices.
- To center an element vertically, you should use a height to its container. In this case it is recommended to use "min-height: 100vh" so that it occupies 100% of the viewport height. e.g.:
body { min-height: 100vh; }
I hope you find it useful! 😄 Above all, the solution you submitted is great!
Happy coding!
Marked as helpful2 - Use semantic elements such as
- @HassiaiPosted over 1 year ago
Replace <div class="container"> with the main tag to fix the accessibility issues. click here for more on web-accessibility and semantic html
There is no need to style .container.
To center .main on the page using grid only instead of grid and margin, add min-height: 100vh to the body and remove the margin value in .main.
For a responsive content which wont require a media query for this challenge, give .main a fixed max-width value and a padding value for all the sides.
padding: 16px, max-width:320px
.Give the img a a max-width of 100% for a responsive image and a border-radius value, the rest are not needed.
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.
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
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