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 Using HTML and CSS

@jaecoder20

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 I found difficult for this project was rounding all edges of the QR code image equally. Whenever I applied border-radius, the top edges would round less than the bottom ones and I'm not sure why.

What are some best practises regarding structuring media queries for responsive design?

Community feedback

@lukasriha

Posted

Hi Jaecoder20,

I think the best practice regarding you are looking for concerning media queries is called "mobile first".The core idea is that you start styling your page/app for mobile devices. Once you're done with that, you start increasing the viewport width, and once something breaks or start looking bad, you add a media query to fix your styles. :) There's an article on css-tricks - it's a great site and I can't recommend it enough.

Also, look up something called BEM - it's a way to organize your css code.

Overall, great work, keep hacking! :)

Marked as helpful

1

@LarsiParsii

Posted

Hi! Just some quick feedback:

  1. Noticed a QR overflow on wider screens. No need for media queries here—just set a max width on the QR code div, and a width to ensure it adjusts on narrower screens. Consider clamp() for responsive sizing. Media queries are better for altering layout/content per screen size. A mobile first approach is a good practice to simplify initial designs, though not crucial for this challenge. :)

  2. The QR code is rounded at the top, but padding pushes the image down, leaving an empty space. Understand the difference between padding and margins, and apply "box-sizing: border-box" to all elements using the universal selector "*". This along with clearing default margins and padding should be among your first steps – it's a game changer! :)

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