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

Solution for the QR code component challenge on Frontend Mentor

@Aky11Taz

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

Hi, good job. Here are a few suggestions to make it even better.

HTML:

  • You need a <main>, this is important for accessibility. Change .container from a <div> to a <main>.

  • The alt text also needs to say where it leads (frontendmentor.io).

  • Footer text needs to be wrapped in a <p>.

CSS:

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

  • Font-size must never be in px. Use rem instead.

  • Since all of the text is center-aligned, you only need to set text-align: center on the body - remove it elsewhere.

  • Remove the fixed width and height on the card. You rarely want to set fixed dimensions, as this easily creates issues with responsiveness.

  • Do add a max-width in rem. This is to prevent it from getting too big on larger screens. Around 20rem should be fine.

  • Remove margin: 4rem auto on the card. Instead, use Flexbox to center the card horizontally and vertically. Since Flexbox needs to be set on the parent, put it on the body:

display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100vh;

Marked as helpful

1
Enis Kerti 590

@eniskrt

Posted

Good job. You can use display:flex; align-items:center; justify-content:center; min-height:100vh; in body element to get the card in the middle of the page.

Good code.

Enis...

Marked as helpful

1

@Aky11Taz

Posted

Thank you @eniskrt

0
Enis Kerti 590

@eniskrt

Posted

You're welcome. :) @Aky11Taz

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