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 with html and css

Carla 180

@CarlaCheikh

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

Tainara 30

@tainarapalmeira

Posted

Hi @CarlaCheikh, Congratulations on completing this challenge! :)))

When I did this very challenge, I had the same issue related to image responsiveness. So here is a good tip to improve it: use the picture tag in your index.html. It allows you to deal easily with different images according to the width of the screen, for example. In this way, you don't need to create two different img tags with different classes (class="desktop-only" and class="mobile-only").

Associated with this, there is also a CSS property that can also help you which is the object-fit. This property specifies how images and videos should be resized to fit their container.

Check the link for the official documentation for <picture> and object-fit property in W3 SCHOOLS: https://www.w3schools.com/tags/tag_picture.asp https://www.w3schools.com/css/css3_object-fit.asp

I hope this helps you and happy coding!

Marked as helpful

1

Carla 180

@CarlaCheikh

Posted

@tainarapalmeira I will check the links and try to fix it, thank you for your help!

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