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

QR Code in a pop-box

Sarah Wylieโ€ข 50

@sarahwylie

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 can't wait to start the next challenge!

Community feedback

Lucas ๐Ÿ‘พโ€ข 104,560

@correlucas

Posted

๐Ÿ‘พHi @sarahwylie, 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:

Your solution is great and the code is working, but the HTML structure can be reduced by removing unnecessary divs, all you need is a single <main> or <div> to keep all the content inside, and nothing more. The ideal structure is the div and only the image, heading, and paragraph.

Hereโ€™s one example to show can be cleaner this HTML structure:

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

To reduce the CSS you can use the direct selector for each element instead of using class this way you have a code even cleaner, for example, you can select everything using the direct selector for (img, h1, and p, main).

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!

1

Sarah Wylieโ€ข 50

@sarahwylie

Posted

@correlucas Thanks, Lucas! I tend to overuse html tags, and I know this. I added in the main to remove the landmark warnings, but then never removed the article tags. Good catch!

I chose not to use the direct selector for much of my CSS as I'm used to building out much larger sites. When I start construction, I always assume what I'm building will grow, so I try to stick to class selectors to avoid styling an element unknowingly. That said, I definitely had the little voice telling me to quit doing extra and stick to the direct selectors on this one since it's such a small and simple challenge that is not meant to be broadened. I guess I need to challenge myself to think smaller?

Thanks again, Lucas!

1
Lucas ๐Ÿ‘พโ€ข 104,560

@correlucas

Posted

@sarahwylie To say you the truth, this will change really few doing the css using the direct selector. Was only one advice to keep your code minimal and an exercise.

To say you the truth in my first upload for this solution I have used a lots of div, classes and even id to give style to component, in my first day here, someone comment on the solution saying me to think about the component and try to create it with the less div blocks/css possible and this html structure was a result of this exercise.

Anyway, your solution was yet perfect this was the only thing I could suggest you =)

Keep it up

0

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