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 solution using flexbox and basic css.

P
jumiranda5 280

@jumiranda5

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


I allways strugle to structure the css file. On this challenge, I separated the page structure and the typography. What would be the best practices on how to organize the css (when we are not using scss and alike)?

Community feedback

T
Grace 28,970

@grace-snow

Posted

Overall this is really good. There's just a few suggestions for improvement and one critical issue you need to fix

  1. The image should ideally have slightly more meaningful alt text like "QR code to FrontendMentor.io"
  2. It's less performant to load the css reset as a separate file
  3. The order of the css is very strange in this. On larger projects you definitely won't want repeating selectors in different places. Usually it's reset, base styles, fonts, then component by component
  4. Avoid complex css selectors or wildcard selectors unless they are absolutely necessary. Eg instead of .qr-container > * you can place text center higher in the DOM and it would be inherited anyway. Complex css selectors increase specificity making the styles harder to manage, especially on large projects. And wildcard selectors are poor for browser performance so should be used sparingly
  5. This is the big critical bug that is essential to change. NEVER change the font size on :root or html, and never set font size in pixels anywhere. That one line of CSS means this fails minimum accessibility standards. Read more here

Marked as helpful

2

P
jumiranda5 280

@jumiranda5

Posted

Thanks a lot, Grace! I thought I had to set the root font size... but now I see I was completly wrong. I'll do my best to apply all of this on the next challenge. (Actually, I'll fix this before moving to the next) @grace-snow

0
P
jumiranda5 280

@jumiranda5

Posted

I've just finished refactoring the css and improving the qr code alt text as you suggested. Thanks again! @grace-snow

0

@ARMoretech

Posted

A very good solution looks exactly like the sample. Good job

0

P
jumiranda5 280

@jumiranda5

Posted

Thanks! :) @ARMoretech

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