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

Responsive QR code using CSS Flexbox

Mai Starberriesβ€’ 80

@starberries

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


What are you most proud of, and what would you do differently next time?

Ultimately I think I did pretty well at getting the size of the elements to match up with the design reference, though feel like I used too much hard-coding on the sizes for my preference.

What challenges did you encounter, and how did you overcome them?

I learned about clamp. I didn't end up using it since the research rabbit hole I was falling into on that topic seemed too time-consuming and excessive for what I needed to accomplish in this case, but learning new things is always a plus.

So anyway, I just ended up using my best guestimates to adjust sizes in pixels, which gets the job done if nothing else.

What specific areas of your project would you like help with?

What do you think, was using pixel measurements and hard-coding width/height a fine call here or was there a better solution that could work here? I definitely feel like designing things with responsiveness in mind is one of the trickier things for me to wrap my head around at the moment.

Updated: After updating the CSS, I've now utilized rem units and max-height/width to provide better responsiveness on especially small screen sizes, courtesy of advice from @weldu0.

Community feedback

Woldu Tsegazgiβ€’ 910

@weldu0

Posted

πŸ‘‹ Hey, @starberries! To answer your question, use rem for most cases and px only when specifically required.

If you’re not familiar with rem or em, try getting into these units because they are much better than px. To convert from px to em:

  • 1em is typically equivalent to 16px (assuming the default font size).
  • To convert pixels to ems, divide the pixel value by 16 (px / 16 = em).

Regarding fixed width/height, there are times when you need them, but for containers like in this case, use max-width and max-height instead.

You can read more about the units here.

Very good course about responsive by Kevin Powell

Like you said, you did very well. Great work! πŸ‘

I hope you find this helpful. 😊

Marked as helpful

1

Mai Starberriesβ€’ 80

@starberries

Posted

Thanks a lot for the advice, @weldu0! I actually didn't even realize rem/em were applicable to sizes beyond font as well, so that's immensely helpful alongside utilizing max-height/max-width, greatly appreciated!

0
Woldu Tsegazgiβ€’ 910

@weldu0

Posted

You're welcome! I'm glad to hear that it was helpful. @starberries

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