@SHMITEnZ
Posted
Ciao Jo!
Congrats on your solution, it really looks good!
For the images I personally used the HTML picture tag, with the below code:
<picture>
<source media="(max-width: 640px)" srcset="images/image-product-mobile.jpg">
<source media="(min-width: 641px)" srcset="images/image-product-desktop.jpg">
<img class="p-img" src="./images/image-product-desktop.jpg" alt="">
</picture>
Hope this helps!
Marked as helpful
@jblaszak
Posted
@SHMITEnZ thank you so much! Definitely going to add this one to my notes. Didn't realize you could use this tag!
@jblaszak
Posted
@SHMITEnZ Added the picture tag and noticed that a CSS reset to display: block
was also required to remove a white space at the bottom.
@SHMITEnZ
Posted
@jblaszak Yes I had the same issue with the white space, I solved it by setting height: 100% on the img. I didn't think about display:block. Thanks!
@jblaszak
Posted
@SHMITEnZ According to this site, the issue is caused from img/picture being treated like an inline element, which causes them to have a line-height property that messes things up as described here