@correlucas
Posted
๐พHi Daniel Earp, 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">
Add <main>
instead of <div>
to wrap the card container. This way you show that this is the main block of content and also replace the div with a semantic tag.
Replace the <h3>
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.
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
or em
instead of px
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.
Instead of using many padding and margins to separate the elements, add a single padding of padding: 15px
only in the container to give the padding around the image and the text and padding-bottom: 14px
to separate the texts and image vertically.
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 helpful
@Earpz1
Posted
@correlucas Thanks for having a look over it and coming back with such a detailed answer. Your comment about adding padding to the main box rather than margin to all in individual elements inside makes so much sense and is clearly a much cleaner way of doing things. Appreciate it!