Design comparison
Community feedback
- @correlucasPosted over 2 years ago
๐พ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
withmax-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
andmax-width
is that the first property is fixed and the second isflexible
, for example, a component withwidth: 350px
will not grow or contract because the size will be ever the same, but a container withmax-width: 350px
ormin-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 usewidth
choose ormin-width
ormax-width
.Make the image resize with the container by adding
max-width: 100%
anddisplay: 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 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