Design comparison
SolutionDesign
Community feedback
- @lukejansPosted about 2 years ago
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@sanchezmiltonPosted about 2 years ago@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
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord