qr-code-component using basic css
Design comparison
Solution retrospective
please would you highlight what section of my code is subpar according to industry standards?
Community feedback
- @ozzy1136Posted about 2 years ago
Your code looks great!
One change I would make is to place the <img/> inside the <article/>, because the image is related to the other content inside the <article/>.
The only other change I would make is to move all the CSS styles that affect the card from the <section/> to the <article/> element (e.g. width, background-color, padding, border-radius). This will make it easier to reuse the code if you wanted to add another card on the page.
Marked as helpful0@Chiwetalu345Posted about 2 years ago@ozzy1136 Thank you soo much for the feedback. i really appreciate it.
1 - @correlucasPosted about 2 years ago
๐พHi @Chiwetalu345, 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:
- Something that can be a time saver for you is to use a CSS RESET to remove all default settings for margins, making the images easier to work, see the article below where you can copy and paste this CSS code cheatsheet: https://piccalil.li/blog/a-modern-css-reset/
- Replace the
<h2>
containing the main title with<h1>
note that this title is the main heading for this page and every page needs one h1 to show which is the most important heading. Use the sequence h1 h2 h3 h4 h5 to show the hierarchy of your titles in the level of importance, never jump a level. - 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@Chiwetalu345Posted about 2 years ago@correlucas Thank you so much for the feedback. I really appreciate that you took some time to go through my code. I will rework my code with your corrections. I hope to get more feedback from you on my future challenges
0
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