Design comparison
Community feedback
- @correlucasPosted about 2 years ago
👾Hi @ailenglassmam, congratulations on your solution!👋 Welcome to the Frontend Mentor Coding Community!
Great solution and a great start! From what I saw you’re on the right track. I’ve few suggestions for you that you can consider adding to your code:
- Add the website favicon inserting the svg image inside the
<head>
.<link rel="icon" type="image/x-icon" href="./images/favicon-32x32.png">
- The main heading has the tag
<h2>
, in this case, you should replace it with<h1>
since this heading is the main title on this page. Remember that every page should have one<h1>
to declare which is the most important title and that you should follow the hierarchy using the heading sequence(h1, h2, h3, h4, h5)
and never jump a level. - Clean your code by removing some unnecessary divs, most of the content can stand alone without a div. Use div only for blocks that need a special alignment or the content needs a special positioning.
- Add a margin of around
margin: 20px
to avoid the card touching the screen edges while it scales down. - Use relative units as
rem
orem
instead ofpx
to improve your performance by resizing fonts between different screens and devices. These units are better to make your website more accessible. REM does not just apply to font size, but to all sizes as well.
Here's my solution for this challenge if you wants to see how I build it: https://www.frontendmentor.io/solutions/qr-code-component-vanilla-cs-js-darklight-mode-nS2aOYYsJR
✌️ I hope this helps you and happy coding!
Marked as helpful0@ailenglassmamPosted about 2 years ago@correlucas I've been studying this for almost a year and reading these comments gives me a little more confidence in what I'm doing. Thank you so much for your advice ! 🤙🏻
0 - Add the website favicon inserting the svg image inside the
- @VCaramesPosted about 2 years ago
Hey @ailenglassmam, some suggestions to improve you code:
I updated your code and updated it with less code and it makes your component responsive.
* { box-sizing: border-box; margin: 0; padding: 0; } body { background-color: hsl(212, 45%, 89%); } main { min-height: 100vh; display: flex; flex-direction: row; align-items: center; justify-content: center; text-align: center; } #card { max-width: 320px; background-color: white; border-radius: 20px; padding: 16px; } img { max-width: 100%; border-radius: 10px; } h2 { font-size: 22px; font-family: 'Outfit', sans-serif; font-weight: 700; padding: 20px 10px; color:hsl(218, 44%, 22%); } p { font-family: 'Outfit', sans-serif; color: hsl(220, 15%, 55%); padding: 0 10px; }
Happy Coding! 👻🎃
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