Prodcut Card using grid, flex, REM

Solution retrospective
This was mostly a review of past "card component" projects.
- How would you suggest I handle the widths for this project (compared to what I did)? Considering they were card components, I assumed it was fine to use "static" widths. Your thoughts? As always, let me know if there's something else I missed. Thank you in advance for your feedback. Cheers!
Please log in to post a comment
Log in with GitHubCommunity feedback
- @ApplePieGiraffe
Hello, Jason Greenwald! 👋
Nice work on this challenge! 🙌 Your solution looks great and is responsive! 👏
A couple of things I'd like to suggest are,
- Using more semantic HTML elements in your markup, which is important for accessibility and SEO-related reasons. For instance, the description of the product should be a
p
element and the "Add to cart" element should be abutton
. If you’d like to learn more about how to write semantic HTML and why it matters, check out this short, helpful course. 😉 - As for setting widths for components such as this, I would set the width of the card component to
100%
and then adding a max-width to it to prevent it from becoming too wide when there's extra space around it. This is often better than setting the width of the element to a fixed value or percentage because it'll ensure that the element only takes up as much space as it should be allowed but also shrinks accordingly when the space around it shrinks.
Hope this helps. 😊
Keep coding (and happy coding, too)! 😁
Marked as helpful - Using more semantic HTML elements in your markup, which is important for accessibility and SEO-related reasons. For instance, the description of the product should be a
- @jaycgreenwald
Just an FYI - Not sure why the title is only takes up two lines in the screenshot. Looking at the live site, it spans three lines just like the design. I appreciate any insight into why this is the case. (It bugs me, but I'm trying to be laid back about it.)
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