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 with additional changes to responsiveness and accessibility

@liammalby

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

@rostyslav-nazarenko

Posted

Hi! Great code!

I found only a few issues with using absolute and relative units. I will explain as much as I can but here is a great article if you need more information.

  • Generally, you would want to use relative units like em or rem. Using rem is easier as it is based on the root font size which is by default 16px, but users can change it in the browser settings. em is based on the parent element font size that way it is harder to set precise font size, read more in the article.
  • In your code you set body { font-size: 15pt; }. pt is an absolute unit, which is used in print. In this case set font-size to 0,9375rem (15 / 16, 15 is your target size, and 16 is the default).
  • But then you set the font size of the p element to 1rem (and you override previous rule) which is 16px (by default) and h1 to 22px. This makes p change its font size according to user preferences and h1 would be stuck and not change its font size.
  • line-height: calc(1.27 * var(--header-font-size)); and line-heigth: 1.27; mean exactly the same.

So, generally, people set font in rem to the body element which makes other elements inherit from body

Marked as helpful

1

@liammalby

Posted

@rostyslav-nazarenko thank you for your feedback! I have hopefully made some adjustments to the way I do things in the most recent challenge I completed :)

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