Not Found
Not Found
Not Found
Failed to decode param 'bilal%F6zkuray'
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-cod

SurafelFikadu• 270

@SurafelFikadu

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

P

@Islandstone89

Posted

HTML:

  • The image has meaning, so it must have proper alt text. Write something short and descriptive, without including words like "image" or "photo". Screen readers start announcing images with "image", so an alt text of "image of qr code" would be read like this: "image, image of qr code". The alt text must also say where it leads(frontendmentor website).

CSS:

  • Including a CSS Reset at the top is good practice.

  • Add around 1rem of padding on the body, so the card doesn't touch the edges on small screens.

  • On the body, change height to min-height - this way, the content will not get cut off if it grows beneath the viewport.

  • Remove all widths in px.

  • Add a max-width of around 20rem on the card, to prevent it from getting too wide on larger screens.

  • font-size must never be in px. This is a big accessibility issue, as it prevents the font size from scaling with the user's default setting in the browser. Use rem instead. I would also decrease the font size, so the card doesn't get too tall.

  • line-height must also never be in px. Use numbers instead; for example, if you want a line-height twice the size of the element's font size, write line-height: 2;.

  • On the image, add display: block and max-width: 100% - the max-width prevents it from overflowing its container.

  • I would decrease the padding on the card to around 16px.

  • As the design doesn't change, there is no need for any media queries. When you do need them, they should be in rem, not px. Also, it is common practice to do mobile styles first and use media queries for larger screens.

Marked as helpful

1

SurafelFikadu• 270

@SurafelFikadu

Posted

@Islandstone89 Hey Haberg Thank You for your time and constructive comment. It's difficult for me to say your comments only comment it's another part of lesson. Thanks A lot .

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