Luke Janssen• 210
@lukejans
Posted
Ouuu this looks very clean and followed the design! I see you got the img to change src depending on page size and im just wondering how you got that to work as i cannot see your css files and only the tailwindcss config file. I would love to hear how you got the images working properly if you want to share. Great work sir!
1
Milton Sánchez• 90
@sanchezmilton
Posted
@lukejans thanks! To change the image, I use the tag "<picture>" with the source inside.
<picture class="md:w-[450px]">
<source srcset="./images/image-product-desktop.jpg" media="(min-width: 768px)">
<source srcset="./images/image-product-mobile.jpg">
<img src="./images/image-product-mobile.jpg" alt="Perfume">
</picture>
Here let you a link to learn about this. GeeksForGeeks
1