@correlucas
Posted
👾Hello Juan, congratulations for your new solution!
You did a good work putting everything together in this challenge, something you can do to improve the image that needs to change between mobile and desktop is to use <picture>
instead of <img>
wrapped in a div. Look that for SEO and search engine reasons isn’t a better practice import this product image with CSS since this will make harder to the image be found. You can manage both images inside the <picture>
tag and use the html to code to set when the images should change setting the device max-width
depending of the device (phone / computer) Here’s a guide about how to use picture
: https://www.w3schools.com/tags/tag_picture.asp
A good practice to have all the image inside the container scaling and respecting the size of the container, you need to add max-width: 100%
and add alsoobject-fit: cover
to make the image auto-crop when resizing inside the column:
img {
display: block;
object-fit: cover;
max-width: 100%;
}
Use a CSS reset to avoid all the problems you can have with the default CSS setup, removing all margins, making the images easier to work, see the article below where you can copy and paste this css code cheatsheet: https://piccalil.li/blog/a-modern-css-reset/
✌️ I hope this helps you and happy coding!