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

SeanGrimes44โ€ข 50

@SeanGrimes44

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

@MelvinAguilar

Posted

Hi @SeanGrimes44 ๐Ÿ‘‹, good job completing this challenge, and welcome to the Frontend Mentor Community! ๐ŸŽ‰

Here are some suggestions you might consider:

The container isn't centered correctly. You can use flexbox to center elements:

body {
  margin: 0;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

Also, remove the padding: 8em from the card selector.

Links with more information:

.

  • Try to use semantic tags in your code. Click here for more information.
  • Use max-width: 18.5em to .card-background selector instead of width, this will make the card container a bit responsive on mobile and set the element's maximum width to 18.5em.
  • Use margin: 0.938rem or margin: 15px in the .card-background selector so that it has some space when viewed on mobile devices.
  • Update the image selector to make responsive images.
img {
    width: 100%;
    object-fit: contain;
    border-radius: 5%;
}
  • The <br> tag is not a semantic tag, so you should not use it. Also, if a screen-reader reads the text, it will break the flow of reading at the line break tag, so it should be used to add vertical spacing. There are only a few cases where it is necessary (for example, in a poem or an address), and it is possible to avoid them by applying padding and margin styles via CSS. More information here.

For example, you could remove the <br> tag and add margin-inline: 1rem; to the <h1> element , margin-inline: 1.5rem; to the <p> element and you would have the same result.

I hope those tips will help you.

Good job, and happy coding!

Marked as helpful

2

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