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 page

chopipi 90

@turtle-jin

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


Open to improvement, thanks!

Community feedback

P

@S067130H

Posted

Hey there! Great job on the solution, it looks great!

One thing I noticed though was your use of the <main> HTML element. This is what is known as a semantic element and is used to encompass the main section of your website. I noticed you attached a container class to it. Since there can ever only be one main element tag inside a document, applying classes should not be necessary. Instead, you might want to consider a structure like so:

<body>
  <main>
      <div class="container">
         [...]
      </div>
  </main>
</body>

This helps with accessibility when it comes to things like screen readers. Other than that, great job! :)

Marked as helpful

0

chopipi 90

@turtle-jin

Posted

@S067130H

Thanks for the feedback! I have updated the semantic element based on your suggestion:)

0
P

@Islandstone89

Posted

Hello! Good job. Here are a few tips :)

HTML:

  • Do not use words like "picture", "image" or "photo" in the alt text. 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". And how it looks isn't as important as what it does, so you don't need to include the bit about the "blue background". The alt text must also say where it leads(frontendmentor.io).

CSS:

  • Performance-wise, it's better to link fonts in the <head> of the HTML than using @import.

  • It's good practice to include a CSS Reset at the top.

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

  • Move font-family to body.

  • The body is a block element, meaning it takes up the full width by default. Hence, you don't need to set the width.

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

  • Remove the width on the card - in general. setting fixed widths and heights is not recommended.

  • 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 bad for accessibility, as it prevents the font size from scaling with the user's default setting in the browser. Use rem instead.

  • Since all of the text should be centered, you only need to set text-align: center on the body, and remove it elsewhere. The children will inherit the value.

  • Paragraphs have a default value of font-weight: 400, so there is no need to declare it.

  • On the image, remove height and object-fit, neither are needed. Add display: block and change width to max-width: 100% - the max-width prevents the image from overflowing its container.

Marked as helpful

0

chopipi 90

@turtle-jin

Posted

@Islandstone89 Thank you so much for the tips! I definitely learned a lot from you! I will update my code using your tips and for future challenges:)

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