@trafiki
Posted
Hi @mkulemeka considering the approach you took, It is necessary that you set width and height of the image. The issue with setting the width and height here is that the image is forced to take the dimension of the container making the image distorted when the dimension of the parent div's container doesn't quite align with the image dimension. To fix this error, all you need to do is add "object-fit: cover;" to your ".main .img img" style rule.
You can read more about the object-fit css property at https://www.w3schools.com/css/css3_object-fit.asp
Let me know if that helps or if you have additional questions.
Cheers :)
Marked as helpful