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

google fonts,

YuvCarlโ€ข 180

@CarlTeclancing

Desktop design screenshot for the QR code component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Community feedback

Lucas ๐Ÿ‘พโ€ข 104,440

@correlucas

Posted

๐Ÿ‘พHello YuvCarl, congratulations for your new solution!

Here's my tips to you improve the qrcode image responsiveness and the card:

Use the proper color for the background: background-color: rgb(214 231 239);

Replace the width with max-width: 350px; to make it responsive:

.card {
    padding: 16px;
    max-width: 350px;
    /* height: 560px; */
    background-color: white;
    display: flex;
    align-items: center;
    flex-direction: column;
    border-radius: 12px;
}

The main difference between width and max-width is that the first property is fixed and the second is flexible, for example, a component with width: 350px will not grow or contract because the size will be ever the same, but a container with max-width: 350px or min-width: 350px can grow or contract depending of the property you've set for the container. So if you want a responsive block element, never use width choose or min-width or max-width.

Make the image resize with the container by adding max-width: 100% and display: block

img {
    max-width: 100%;
    /* width: 95%; */
    /* height: 350px; */
    /* margin: 10px; */
    /* padding: 15px; */
    border-radius: 14px;
    border-radius: 12px;
    display: block;
}

๐Ÿ‘‹ I hope this helps you and happy coding!

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