Design comparison
Community feedback
- @correlucasPosted over 2 years ago
πΎHello again Jerry, congratulations for solution!
Here's my tips to improve the QR CODE image responsiveness and the container:
Replace
width: 260px;
withmax-width: 260px;
.container { max-width: 260px; height: 430px; padding: 15px 15px 20px; background-color: hsl(0, 0%, 100%); border-radius: 10px; }
The main difference between
width
andmax-width
is that the first property is fixed and the second isflexible
, for example, a component withwidth: 260px
will not grow or contract because the size will be ever the same, but a container withmax-width: 260px
ormin-width: 260px
can grow or contract depending of the property you've set for the container.To make the qrcode image responsive and respect the container size use
display: block
andmax-width: 100%
img { display: block; max-width: 100%; }
π I hope this helps you and happy coding!
Marked as helpful0
Please log in to post a comment
Log in with GitHubJoin 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