Design comparison
Solution retrospective
could anybody help me with advice about sizing of div and mobile vers. because i have problems with it :( What did you find difficult while building the project? Which areas of your code are you unsure of? Do you have any questions about best practices?
Community feedback
- @correlucasPosted about 2 years ago
๐พHello NikitaBenzin, Congratulations on completing this challenge!
I've just opened your live site and I can say that you did a great job putting everything together! There's some tips to improve your solution: Your component is perfect, but is not responsive yet, this is due the
fixed width
you've applied to the container.Look both
width
andmax-width
the main difference between these properties is that the first(width) is fixed and the second(max-width) isflexible
, for example, a component withwidth: 320px
will not grow or shrink because the size will be ever the same, but a container withmax-width: 320px
ormin-width: 320px
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
.The image is not responsive yet, a quick way to make any image responsive and respecting the container size is to add
display: block
andmax-width: 100%
to the<img>
selector. To improve the responsiveness even more adding the auto-crop property you can addobject-fit: cover
to make the image crop inside the container its inside.img { display: block; object-fit: cover; max-width: 100%; }
โ๏ธ I hope this helps you and happy coding!
Marked as helpful2
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