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

Simple solution for QR component using basic BEM

@omiras

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


  • Switch from background-image to <img> because it was quite a nightmare to set a white border radius for the QR code image...

Community feedback

Hassia Issah 50,670

@Hassiai

Posted

Give .qr a padding value for all the sides, there is no need to style .qr--code. Giver img a max-width of 100% instead of a height value. give .qr--information a padding value for all the side and give h1 a margin bottom value or p a margin top value.

.qr{padding: 1rem;} 
img{max-width:100%}
.qr--ingromation{ padding: 1rem:}
p{margin-top: 1rem;}

Hope am helpful.

Well done for completing this challenge. HAPPY CODING

Marked as helpful

1

@omiras

Posted

@Hassiai I implemented your suggestions: I find it's cleaner and easier code than mine.

To be honest I was not completely ok using height for the image. Thank you very much for your comment!

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