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 (HTML + CSS)

Leonard 1,025

@leoikeh99

Desktop design screenshot for the Product preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Any and all feedback are welcomed.

Community feedback

Prantik 660

@prantiknoor

Posted

Hey @leoikeh99. I have a little recommendation.

You used two img (one for mobile & another for desktop). You switched between images using display property.

But there is a better alternative solution. You can use picture. as an example:

  <picture class="image">
        <source media="(max-width: 630px)" srcset="./images/image-product-mobile.jpg">
        <img src="./images/image-product-desktop.jpg" alt="product image" class="desktop" />
   </picture>

Marked as helpful

0

Leonard 1,025

@leoikeh99

Posted

@prantiknoor Thank you very much for this, i'll use this

0

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