Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Product preview card component

@sanchezmilton

Desktop design screenshot for the Product preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Community feedback

@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

@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

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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