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

I have used flexbox

@gracebir

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


nothing difficult

Community feedback

@catherineisonline

Posted

Nice solution 🤩

To improve the code you can add alt attribute to the images and there are several tips you need to follow. If the image is just for decoration you can still write alt attribute but leave it empty, such images don’t need any alt tag but you will need to also add aria-hidden=“true”.

According to MDN “The alt attribute holds a text description of the image, which isn't mandatory but is incredibly useful for accessibility — screen readers read this description out to their users so they know what the image means. Alt text is also displayed on the page if the image can't be loaded for some reason: for example, network errors, content blocking, or linkrot.“

IF THIS WAS HELPFUL PLEASE MARK IT AS HELPFUL 🤩

Marked as helpful

1
Favour 2,140

@Nadine-Green

Posted

HEY GRACE!

I couldn't help but notice immediately that the font size of your contents are too big, I have done this challenge myself and according to the style guide, the font size for the paragraphs should be 15 px or 0.9375rem, the size of your h1 element should also be greatly reduced, doing so will not only improve the user experience but it will also prevent the contents of your container from spilling out, which is currently the problem.

IF YOU FOUND THIS IN ANY WAY USEFUL, DON'T HESITATE TO MARK IT AS USEFUL :)

HAPPY CODING!

0

@VCarames

Posted

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

  • To not only improve your HTML code but to also identify the main content of you page, you will want to wrap your entire component inside the main element.

More Info:📚

MDN Main Element

  • The image’s alt tag description needs to be improved upon to better describe what it is. You will want to assume that you are describing the image to a someone.

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!🎄🎁

0

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