Design comparison
Solution retrospective
What did you find difficult while building the project? Which areas of your code are you unsure of? Do you have any questions about best practices?
Community feedback
- @correlucasPosted about 2 years ago
πΎHello Jimmy Lee, congratulations for your new solution!
Your product card is really good done, you've missed only the alignment and theres a better approach for the image switch between mobile and desktop.
Here's my tips:
Align the component with
flexbox
:body { min-height: 100vh; background: hsl(30, 38%, 92%); display: flex; align-items: center; justify-content: center; }
Look that you can also manage the product image inserting the tag
<picture>
instead of<img>
to wrap both desktop and mobile images together in the same tag, and render each image depending of the device (phone / computer) by the settings for the width you'll insert in the html If you're not familiar with thepicture tag
you can look at the documentation to see how to set it:https://www.w3schools.com/tags/tag_picture.asp
π I hope this helps you and happy coding!
Marked as helpful0
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