Design comparison
SolutionDesign
Solution retrospective
The responsive part gave me some headache. I switched the card to grid-layout to make it work. Maybe not the best solution but i'm happy with it.
Community feedback
- @ahmedafsaPosted 11 months ago
Hello @Saitenhexer, Good job!
You can employ the
<picture>
element with<source>
tags and media queries to make the product image responsive- HTML:
<picture> <source srcset="images/image-product-mobile.jpg" media="(max-width: 600px)" /> <source srcset="images/image-product-desktop.jpg" media="(min-width: 601px)" /> <img src="images/image-product-desktop.jpg"/> </picture>
- CSS:
@media (max-width: 600px) { .your-grid-container { grid-template-columns: 1fr; } }
Marked as helpful0@SaitenhexerPosted 11 months ago@ahmedafsa
Thank you! Thats is a nice way to change the picture!
I will try it :)
0
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