Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

First attempt QR Code

Daniel Earpโ€ข 100

@Earpz1

Desktop design screenshot for the QR code component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


I'm very new to front end work and I am currently completing an intensive coding bootcamp. This is my first attempt at a Frontend Mentor challenge & only my second attempt at creating a CSS design. I think I've got close to the spec but I'm sure I didn't do it the "best way" so any advice on that would be great.

Community feedback

Lucas ๐Ÿ‘พโ€ข 104,420

@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

0

Daniel Earpโ€ข 100

@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!

0
Remtaineโ€ข 360

@remtaine

Posted

The design looks pretty good. For the content, it's better if instead of manually centering it through pixel margins, you center it using either auto margins or flex. That way you don't have to calculate every time. Also, the text at the bottom overflows. If you want them all contained in the parent white box, don't set a constant height and just add padding for spaces.

All in all it's good though! Keep it up!

Marked as helpful

0

Daniel Earpโ€ข 100

@Earpz1

Posted

@remtaine Thank you so much for taking the time to reply. I have another lecture today but will certainly go over it again and take another stab at it!

0
Murtaza Nikzadโ€ข 90

@MurtazaKafka

Posted

The design is great, except that it has just a bit of typography issue. You could possibly change the contrast of font color against the background color and add some "padding-bottom" to the description piece of text at the end. But still, this is really great. Keep it up.

1

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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