Submitted about 3 years agoA solution to the Product preview card component challenge
Product Preview Card | BEM, SASS
bem, sass/scss
@john-jpann

Solution retrospective
Do you have any questions about best practices?
So, I am curious about the following code snippet, is wrapping an image tag inside of a wrapper in this case a figure tag a good idea? I personally find it easier to deal with images this way.
<figure class="product-preview-card__image-container">
<img
src="./images/image-product-desktop.jpg"
srcset="./images/image-product-mobile.jpg 2x"
alt="Gabrielle Essence Eau De Parfum in a bottle"
/>
</figure>
On another note, I don't often use SRCSET. Was this a good use case for it, or are there better ways of working with multiple images?
Thanks for checking out my project!
Code
Loading...
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on John's solution.
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