Design comparison
Solution retrospective
I remembered that I can do border-radius on both img and a wrapper or do it via overflow:hidden but I messed it up somehow so went for border-radius for both wrapper and an img
Community feedback
- @MelvinAguilarPosted almost 2 years ago
Hello there π. Good job on completing the challenge !
I have some suggestions about your code that might interest you.
HTML π:
- Use the
<main>
tag to wrap all the main content. With this semantic element you can improve the accessibility of your page.
Alt text π·:
- The
alt
attribute should not contain the words "image", "photo", or "picture", because the image tag already conveys that information.
-
The
alt
attribute should explain the purpose of the image. Uppon scanning the QR code, the user will be redirected to the frontendmentor.io website, so a betteralt
attribute would beQR code to frontendmentor.io
If you want to learn more about the
alt
attribute, you can read this article. π.
CSS π¨:
- To center the component in the page, you should use Flexbox or Grid layout. You can read more about centering in CSS here π.
body { margin: 0; font-family: "outfit"; background-color: hsl(212, 45%, 89%); min-height: 100vh; display: grid; place-content: center; } #card { background-color: hsl(0, 0%, 100%); max-width: 20rem; /* margin: 20rem auto; */ padding: 0.5rem; border-radius: 6px; }
I hope you find it useful! π
Happy coding!
0@0xevPosted almost 2 years ago@MelvinAguilar Thank you for a great feedback, Melvin!
You're very right about the <main> tag, I don't know how I forgot about it
Good stuff about the <alt> too, I didn't know that
Regarding centering document, at the current stage I great about centering content on X axis (regarding these small projects), hope it's not a big deal
Have a great day!
0 - 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