Submitted over 1 year ago
Product Preview Card Component using React, SCSS only
@MrMohammedMath
Design comparison
SolutionDesign
Community feedback
- @0xabdulkhaliqPosted over 1 year ago
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 helpful1
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