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

Mateusz 150

@matsta92

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


Hello, please rate the project - Product preview card component.

I am a beginner.

I will be happy to receive tips on any mistakes I may have made in the code. So as not to develop bad habits.

Community feedback

@dmuri

Posted

Hi there 👋

Really nice work, for the image swapping it is considered best practise to use picture and srcset tags. See an example below

    <picture>
        <source media="(min-width: 800px)" srcset="large-image.jpg">
        <img src="small-image.jpg" alt="Description of image">
    </picture>

Here the "large.img will be used for screens wider than 800px and small will be displayed on screens under that.

Here is an article on the topic: https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images

Keep up the good work my friend!

Happy coding!

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