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

Responsive QR code component

P
KurtJFβ€’ 150

@KurtJF

Desktop design screenshot for the QR code component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Community feedback

Vanza Setiaβ€’ 27,795

@vanzasetia

Posted

Hello, KurtJF! πŸ‘‹

Congratulations on completing your first Frontend Mentor challenge! πŸŽ‰

Regarding your questions:

  • It's possible to finish this challenge without using any div elements. I suggest removing the div with the class of .card. Also, it's not a necessary thing to wrap the text elements (h1 and p) with a div. I suggest making those elements as the child elements of the main element. For the attribution, you can swap the div with a footer instead.
  • I think you have done a great job on using CSS custom properties. But, it's hard to tell how well it is since the project is a small project though. πŸ˜…

Some suggestions from me.

  • The alternative text for the QR code can be improved. Try to tell the users about the QR code. By the way, have you tried to scan the QR code?
  • I recommend adding width and height attributes to each image element. This way, the browser knows how much space the image requires before it can be fully loaded. As a result, it would optimize CLS (Cumulative Layout Shift). As a side note, it is not the same as width and height CSS properties. So, make sure you learn how to use them.

That's it! I hope you find this useful! 😊

Marked as helpful

1

P
KurtJFβ€’ 150

@KurtJF

Posted

@vanzasetia Thank you for your detailed response regarding my questions! It really helped a lot, Also I have updated my solution.

If you don't mind me asking, How can I tell if the div is not needed?

Again thank you very much for the comments and I will keep them in mind when tackling the other challenges. πŸ‘

0
Vanza Setiaβ€’ 27,795

@vanzasetia

Posted

@KurtJF Happy to hear that was helpful! 😊

In this case, you don't need any div because you can use the main element as the container of the elements inside it. Also, the attribution should be a footer to fix the issue that has been reported.

In general, you want to keep the HTML markup as simple as possible. So, I recommend trying to write as minimum HTML as possible. After that, if it needs div to wrap the elements in order to create two-column layouts then use a div.

The point is to use div when it is needed. πŸ™‚

By the way, good job with the update! The HTML markup looking good to me. πŸ‘

Marked as helpful

0
Lucas πŸ‘Ύβ€’ 104,420

@correlucas

Posted

πŸ‘ΎHello again Kurt, congratulations for your new solution!

Great great great solution you've here, I liked a lots that you html structure is super clean this is amazing Kurt. If you want to clean even more you code you can remove all the classes and use the direct selector for each element to manipulate the CSS, for example select everything with main, img, h1 and p.

All you need to make this container responsive is to replace width: 320px; with max-width: 320px;

.card-container {
    border-radius: 22px;
    margin: auto;
    background-color: var(--white);
    max-width: 320px;
    padding: 16px;
}

πŸ‘‹ I hope this helps you and happy coding!

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