Product Preview Card Component using React, SCSS only

Please log in to post a comment
Log in with GitHubCommunity feedback
- @0xabdulkhaliq
Hello there 👋. Congratulations on successfully completing your third challenge! 🎉
- I have other recommendations regarding your code that I believe will be of great interest to you.
HTML 🏷️:
- Since the images in this component adds value and serve a purpose (displaying the product) it needs to be accessible. The image needs to be applied using the
picture
element and not thebackground-image
property, as it will not only let you use different images during different breakpoints it will let apply analt
tag description to image stating what the image is.
Syntax:
<picture> <source media="(min-width: )" srcset=""> <img src="" alt=""> </picture>
- More Info 📚:
picture
element
- Currently, the old price (169.99) 🏷 is not being properly announced to screen readers. To fix this, you are going to wrap the the price in a
del
element and inside it you will add aspan
element with ansr-only
class that will state something like“The previous price was…”
and use CSS to make it only visible to screen readers.
- More Info 📚:
del
element
I hope you find it helpful 😄 Above all, the solution you submitted is great !
Happy coding!
Marked as helpful
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