QR Code Component

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?
Please log in to post a comment
Log in with GitHubCommunity feedback
- @grace-snow
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 helpful - @annazofka
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 - @onyedikachi23
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 helpful
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