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

@YosefHayim

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

nilmus 80

@nilmus

Posted

I see that to switch from the mobile-image to the desktop-image, you used display: none inside your media query.

This works, but note there is a better solution by using the figure element and giving it an img and a source, like so:

<figure
    <source
        media="(min-width: 1024px)"
        srcset="images/image-product-desktop.jpg"
    />
    <img
        class="product-image"
	src="images/image-product-mobile.jpg"
	alt="perfume image"
    />
/>

Marked as helpful

0

@YosefHayim

Posted

@nilmus Thanks alot!

0

@YosefHayim

Posted

@nilmus Thanks alot!

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