Design comparison
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
- @grace-snowPosted 11 months ago
This looks like a great solution to me. Don't stress so much!
Only very minor suggestions from me:
- Consider adding some space between footer and the card. They shouldn't be touching like I see on my phone
- The space between the component and screen edges is really tiny on my phone. Consider increasing that slightly
- It's a good habit to get into ASAP to include a modern css reset at the start of the styles in every project
- There is no need for a media query in this. Don't add unnecessary bloat
- Similarly, there is no need for a div wrapping the image
- Try not to make image alt text too verbose. This only needs to say QR code to FrontendMentor.io.
Marked as helpful1@LeonCelestinoPosted 11 months agoHello @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@grace-snowPosted 11 months ago@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 - @annazofkaPosted 11 months ago
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 helpful1@grace-snowPosted 11 months ago@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 helpful1@annazofkaPosted 11 months ago@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@grace-snowPosted 11 months ago@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 helpful1@LeonCelestinoPosted 11 months agoHello @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@annazofkaPosted 11 months agothank you for such a comprehensive explanation @grace-snow, so helpful :)
0 - @onyedikachi23Posted 11 months ago
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 containerdiv
, and apply your layout structure.For a simple design like this, it is responsive enough.
Marked as helpful1
Please log in to post a comment
Log in with GitHubJoin 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