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

Dhia 710

@Dhia-18

Desktop design screenshot for the Product preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Community feedback

P
Daniele 300

@dedo-dev

Posted

Hi Dhia, great work to solve this challenge, I looked to your code because I need to solve a problem that I encountered and I found something where I can give you some tips.

  1. To render proper images based on display size you need to use a <picture> tag instead of two <img> tags with display: none set on it; Here is a useful article for getting started with picture element

  2. Use relative units instead of px, for example for padding and media queries you can use em while for margin, border-radius or font-size you can use rem; Here an article to getting started with relative units

  3. Try to make your alt text more descriptive and avoid the word image because the screen readers start with ' image of ', in your case this will sound like ' image of product image '. Try with something like this ' A bottle of Chanel Gabrielle Parfum ' this is still poor alt text but it describes better the image to people with disabilities.

Hoping you find this useful ✌️

Keep Learning 📖 Keep Coding 💻

Marked as helpful

0

Dhia 710

@Dhia-18

Posted

@dedo-dev Thanks for your feedback Daniele, I really appreciate it!

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