Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Product Preview Card Component - using pure HTMS & CSS

P

@jguleserian

Desktop design screenshot for the Product preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


I would love any constructive feedback, positive or negative, but would especially welcome comments on:

  1. Does the code seem to conform to best practices?
  2. Are there ways to shorten my CSS to make its loading faster or more efficient?
  3. Are my methods systematic and understandable, or would more notes be helpful in a file of this size

Thank you for your help. Happy new year, everyone!

JTG

Community feedback

@VCarames

Posted

Hey there! 👋 Here are some suggestions to help improve your code:

  • The image’s alt tag description needs to be improved upon ⚠️. Assume that you are describing the image to a someone over the phone.

More Info:📚

https://www.w3.org/WAI/tutorials/images/

  • This component requires the use of two images 🎑 at different breakpoints ⚠️. The picture element will facilitate this.

Here is an example of how it works: EXAMPLE

Syntax:

  <picture>
    <source media="(min-width: )" srcset="">
    <img src="" alt="">
  </picture>

More Info:📚

https://www.w3schools.com/html/html_images_picture.asp

  • 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 a span element with an sr-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

If you have any questions or need further clarification, feel free to reach out to me.

Happy Coding! 🎆🎊🪅

Marked as helpful

0

P

@jguleserian

Posted

@vcarames Thank you for the awesome feedback. I remember learning some of these concepts in the past, but I had forgotten about them. This is a great reminder.

With regard to your comment about making "Gabrielle Essence Eau De Parfum" the only heading element, I am curious about the reasoning for this. My thought was that the word "PERFUME" at the top of the card is a "type" or "category" of product and so needed more attention. Is the reasoning behind leaving it as a paragraph that a screen reader will announce it differently or out of order (since the "PERFUME" is a lower level heading) if not? Or, is it just considered a best practice since "Perfume" is not a subcategory of "Gabrielle..."?

I appreciate you taking time to look through my code and helping me make it better. I am also grateful for the links you provided.

Have a wonderful new year! Jeff

0
P

@jguleserian

Posted

@vcarames Thank you for the awesome feedback. I remember learning some of these concepts in the past, but I had forgotten about them. This is a great reminder.

With regard to your comment about making "Gabrielle Essence Eau De Parfum" the only heading element, I am curious about the reasoning for this. My thought was that the word "PERFUME" at the top of the card is a "type" or "category" of product and so needed more attention. Is the reasoning behind leaving it as a paragraph that a screen reader will announce it differently or out of order (since the "PERFUME" is a lower level heading) if not? Or, is it just considered a best practice since "Perfume" is not a subcategory of "Gabrielle..."?

I appreciate you taking time to look through my code and helping me make it better. I am also grateful for the links you provided.

Have a wonderful new year! Jeff

1

@VCarames

Posted

@jguleserian

Glad I could help! 😁 Happy New Year as well!

This component would be part of larger site. So the user would have already navigated to the "perfume" section of the site, so having the "perfume" as a heading makes no sense (Think Sephora or Macys).

1

Please log in to post a comment

Log in with GitHub
Discord logo

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