Design comparison
SolutionDesign
Community feedback
- @MelvinAguilarPosted almost 2 years ago
Hello there π. Good job on completing the challenge !
I have some feedback for you if you want to improve your code.
HTML π:
- Use the
<main>
tag to wrap all the main content of the page instead of the<section>
tag. With this semantic element you can improve the accessibility of your page.
- Use the
<footer>
tag to wrap the footer of the page instead of the<div class="attribution">
. The<footer>
element contains information about the author of the page, the copyright, and other legal information.
- You must use a level-one heading (h1) even though this is not a full-page challenge. You can create an '<h1>' element within your 'main' element that will be hidden visually but visible and readable by screen readers. The class "sr-only" hides content visually and here are the styles to copy. e.g.:
<h1 class="sr-only">QR Card Component</h1>
- Since this component involves scanning the QR code, the image is not a decoration. You must not use the background-image property to add the QR code image. Instead, use the
<img>
tag to add the image. Use the background-image property only for decorative images that do not add any information to the page.
CSS π¨:
- Instead of using pixels in font-size, use relative units like
em
orrem
. The font-size in absolute units like pixels does not scale with the user's browser settings. This can cause accessibility issues for users who have set their browser to use a larger font size. You can read more about this here π.
- To correctly center the component use a height to the body element
body { background-color: hsl(212, 45%, 89%); padding: 1rem; /* width: 375px; */ min-height: 100vh; align-items: center; display: flex; flex-direction: column; justify-content: center; } @media (min-width: 375px) { body { /* align-items: center; */ /* display: flex; */ /* flex-direction: column; */ /* width: 1440px; */ /* justify-content: center; */ }
I hope you find it useful! π Above all, the solution you submitted is great!
Happy coding!
Marked as helpful1 - Use the
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