Design comparison
Solution retrospective
open to all crictics, tell me where to improve
Community feedback
- @correlucasPosted about 2 years ago
πΎHi @Babsman123, 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:
The HTML structure is fine and works, and you can reduce at least 20% of your code by cleaning the unnecessary elements, you start cleaning it by removing some unnecessary
<div>
. For this solution you wrap everything inside a single block of content using<div>
or<main>
(better option for accessibility) and put inside the whole content<img>
/<h1>
and<p>
.<body> <main> <img src="./images/image-qr-code.png" alt="QR Code Frontend Mentor" > <h1>Improve your front-end skills by building projects</h1> <p>Scan the QR code to visit Frontend Mentor and take your coding skills to the next level</p> </main> </body>
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 - @vanzasetiaPosted about 2 years ago
Hello, Tunde! π
Congratulations on completing your first Frontend Mentor challenge! π
Here are some suggestions for improvements.
- There should be only one
h1
and onep
. Each of those texts only make sense when it is read as one sentence. - Also, it is not a best practice to have many
h1
on a page. It can confuse the screenreader users because there will be many titles for a single page. I recommend reading the "How-to: Accessible heading structure - The A11Y Project" article to learn how to use headings correctly. - The QR code is an important image. It needs to be visible to the users of assistive technology as well. So, I recommend adding an alternative text that describes the QR code.
- I recommend adding
rel="noopener"
to any anchor tags that havetarget="_blank"
. It helps protect users of legacy browsers. I suggest reading "Links to cross-origin destinations are unsafe" article to learn more about this. - To place the card in the center of the page, I recommend using flexbox or grid. These modern techniques are more robust than absolute positioning and require less code to implement.
- In your CSS, I noticed this selector
.qr-code .qr-description .qr-description-header
which would much be as.qr-description-header
. I recommend using single-class selectors for styling whenever possible. Doing this will keep the specificity of the stylesheet as low as possible.
That's it! I hope you find this useful!
Marked as helpful0 - There should be only one
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