@VCarames
Posted
Hey there! π Here are some suggestions to help improve your code:
- Since the images in this component add 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.
Here is how it looks like implemented: EXAMPLE
Syntax:
<picture>
<source media="(min-width: )" srcset="">
<img src="" alt="">
</picture>
More Info:π
https://www.w3schools.com/html/html_images_picture.asp
- Do not uppercase β "perfume" in HTML as it is not accessible friendly. Instead you will want to style it in CSS.
- The only heading β οΈ in this component, is the name of the perfume; βGabrielle Essence Eau De Parfumβ . The rest of the text should be wrapped in a
paragraph
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 anvisually-hidden
class that will state something like βThe previous price wasβ¦β and use CSS to make it only visible to screen readers.
More Info:π
If you have any questions or need further clarification, feel free to reach out to me.
Happy Coding! πππͺ
Marked as helpful
@kumarmash
Posted
@vcarames Thank you so much. I will work upon your suggestion and let you know if any help needed. :)