@correlucas
Posted
👾Hello @s9trange, Congratulations on completing this challenge!
Nice code and nice solution! You did a good job here putting everything together. I’ve some suggestions for you:
1.The image is getting distorted, to avoid this behavior, use these steps, first add display: block
and max-width: 100%
to the <img>
selector. To improve the responsiveness even more by adding the auto-crop property you can add object-fit: cover
to make the image crop inside the container. Here’s the code:
img {
display: block;
object-fit: cover;
max-width: 100%;
}
2.Use the tag <picture>
to wrap the product image inside the html instead of using it as <img>
or background-image
(with the css). Using <picture>
you wrap both images (desktop and mobile) and have more control over it, since you can set in the html when the images changes setting the screen size for each image.ote that for SEO / search engine reasons isn’t a better practice import this product image with CSS since this will make it harder to the image.
Here’s the documentation and the guide to use this tag:
https://www.w3schools.com/tags/tag_picture.asp
✌️ I hope this helps you and happy coding!
Marked as helpful
@s9trange
Posted
@correlucas thank you boss