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

Leonardo 30

@LeonCelestino

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


Hello! I've been awayy from frontend coding for a while because of the college, and thus I forgot somethings and I am studying from the basics again and going through frontendmentor roadmap to help me build the foundations. I've done the QR Code Component challenge today, and I am looking forward to any critiques and tips to improve my skills.

A thing I found hard to do was to match the "bottom" of the card with the design and also to match the text breaklines on the screen sizes mentioned on "style-guide", I was able to think just about using padding-bottom and max-width with ch unit.

Also, I am very insecure about the responsive part, I always struggle on this. Specifically speaking, I don't know if it is properly responsive or accessive, and also if the box or texts sizes should shrink while the screen size decreases, as when the screen width gets smaller then 300px it starts looking weird. I want also to know if it is okay to let the height of the component be as it is, because on really small screens you need to scroll and the card won't fit properly. I also don't know if using max-width with ch on texts is ok.

What would be the proper way to deal with the issues mentioned on the paragraphs above? And, about my html structure, is it alright ? If not, how could I improve it?

Community feedback

T
Grace 29,310

@grace-snow

Posted

This looks like a great solution to me. Don't stress so much!

Only very minor suggestions from me:

  1. Consider adding some space between footer and the card. They shouldn't be touching like I see on my phone
  2. The space between the component and screen edges is really tiny on my phone. Consider increasing that slightly
  3. It's a good habit to get into ASAP to include a modern css reset at the start of the styles in every project
  4. There is no need for a media query in this. Don't add unnecessary bloat
  5. Similarly, there is no need for a div wrapping the image
  6. Try not to make image alt text too verbose. This only needs to say QR code to FrontendMentor.io.

Marked as helpful

1

Leonardo 30

@LeonCelestino

Posted

Hello @grace-snow! Thank you very much about the feedback. Aside from the 3rd suggestion, I tried to match what you said.

If it doesn't bother you, would you check if it is alright now? I would be very pleased with any more suggestions and tips!

0
T
Grace 29,310

@grace-snow

Posted

@LeonCelestino looks good. I'd consider using classes instead of element selectors in css and have a think about why you've used h3

0

@annazofka

Posted

Hey Leonardo There was no need for a responsive design with this challenge. If you look at instructions, it says "card layout doesn't shift" :) There are not many (if any) screen sizes that are less than 300px in width. From what I understand, the smallest screen size you should design for is 320px. As for breaking the text, why not just use the </br> tag? Alse, media queries should alway sit at the end of the CSS file. Hope this is helpful. A.

Marked as helpful

1

T
Grace 29,310

@grace-snow

Posted

@annazofka good feedback except don't use br for line breaks. Let text break naturally based off available space. You would almost never be able to add things like brs in a real world scenario because content is written by editors and stored separately on real projects. Also screen readers with certain settings turned on will hear "break" announced which would be very jarring to hear mid-sentence

Marked as helpful

1

@annazofka

Posted

@grace-snow it's interesting to know brs are not really used in the real world. I was taught to use brs to make sure text breaks in the right places per client's specification in the design files. Would you recommend forgetting brs altogether? Thank you

0
T
Grace 29,310

@grace-snow

Posted

@annazofka it's very rare you will need or want to use them. I actually have a client at the moment who is insisting on all headings (of varying lengths and varying number of words) break over 2 lines. But this is the first time this has ever happened in my career that I've had a client like that. They are an architecture firm and very caught up in a "static print brochure" way of thinking. This will be the first time I recommend they add brs to their content but only because it will not be possible to give them the outcome they want (and will result in a worse experience for some users)

Brs are fine to add at the end of sentences when there is a natural break. They shouldn't be added mid-sentence/phrase. But that is still a content editor choice not a frontend developer one. If we want to limit line length we use max-width (eg in ch units if used on a heading, in rem if used on a component) and/or padding/margin to achieve the designers intention

Marked as helpful

1
Leonardo 30

@LeonCelestino

Posted

Hello @annazofka ! Thank you very much about the feedback. I've done some changes on my code following what you both said.

If it doesn't bothers you, would you check if it is alright now? I would be really greatful about any more suggestions and tips

1

@annazofka

Posted

thank you for such a comprehensive explanation @grace-snow, so helpful :)

0

@onyedikachi23

Posted

Your HTML structure is alright.

For the CSS, your usage of the Grid Layout, that is display: grid; is uncalled for. A simpler Layout structure like Flexbox would be recommended.

Avoid applying your layout designs directly to the body element. Instead nest a container div, and apply your layout structure.

For a simple design like this, it is responsive enough.

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