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 component

P

@dattuannguyen

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

geomydas 1,060

@geomydas

Posted

The code is pretty standard but here are some things that I would suggest the following:

  • Don't set a fixed width on larger elements that are guaranteed to shrink at a certain screen size. Use max-width in a fixed unit such as px or rem and a width in percentage or just w-full in tailwind. You can use max-w-72 instead paired with w-full in your code on the second nested div

  • No need to add more divs unless necessary. For the first div, you could've just applied the styles directly in the body and use min-h-screen instead because if the content exceeds the height, it will still grow unlike h-screen which hides the content

  • No need to declare attributes that are in the defaults already. Its useless and makes your code a bit more messier. An example is using h-auto in the img, you can just omit it and it will still work the same

  • Don't add unnecessary margins. You can remove the m-2 class on your second nested div and it will make your card perfectly centered without offset.

  • Don't use flex too much. Using flex to make a row of cards, center something are okay, but you can just use margins on the y axis on the paragraphs, headings, and images since the space between them are all diff

Marked as helpful

0

P

@dattuannguyen

Posted

@geomydas Thank you so much for your feedback; it was really helpful!

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