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

Flex, html5

Chris 30

@WebDevRock

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


The biggest challenge I had on this one is to get the font pixel perfect in size and dimensions. I still haven't managed so any pointers would be greatly appreciated

Community feedback

@djbedford

Posted

I think your design looks great, and the font size/positioning is pretty spot on as it is, at least to the point where nobody should say anything about it. If you did however want to play around with the text either in the future or on this project you could maybe take a look at these CSS properties

  • letter spacing (https://css-tricks.com/almanac/properties/l/letter-spacing/)
  • line height (https://css-tricks.com/almanac/properties/l/line-height/) These properties should give you finer control over the font to achieve what you were looking for.

Marked as helpful

1
Vanza Setia 27,795

@vanzasetia

Posted

Hi, Chris! 👋

When completing challenges, I recommend avoiding focusing on chasing pixel perfection. It's impossible to create pixel perfect website. Every device's pixel is different. So, it is not possible to create a pixel-perfect website.

Instead, focus on quality by testing with keyboards, zoom, and screenreaders. Also, I recommend visiting Solid Start website. It gives you an overview of web accessibility.

Here are some suggestions for improvements.

  • There's no need to wrap the img with a div.
  • I suggest making the img as a block element (display: block) to make it easier to work with img element.
  • The alternative text of the QR code should give some information about the QR code. For example, "QR code to frontendmentor.io".
  • Specify the font-size on the body element instead on the html element.
  • It's best to never style html element. Use body element as the main element for the website.
  • Also, use rem unit for the font-size. px won't adapt when the users change the font size through the browser's setting.
  • The .card only needs a max-width to be responsive. So, remove the width.
  • I recommend making the body element as the flex container of the card. This way, the .card will be on the main element. This way, there's no need for an extra div.

I hope this helps! Happy coding!

Marked as helpful

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