Design comparison
Community feedback
- @tainarapalmeiraPosted about 2 years ago
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 helpful1@CarlaCheikhPosted about 2 years ago@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 GitHubJoin 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