Design comparison
SolutionDesign
Community feedback
- @Djamel1133Posted about 1 month ago
Well done, I liked your code. However, to prevent images from being stretched (or smached), it's important to add the
object-fit: cover
property to your.card img
.Here's how you can do it:
.card img { width: 100%; height: 100%; object-fit: cover; }
This ensures that the image maintains its aspect ratio and fits the container without distortion. You can learn more about the
object-fit
property [https://www.w3schools.com/css/css3_object-fit.asp].Good job hope it was helpful !
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