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 ( Vanilla CSS + ScrollReveal.js )

#accessibility#animation
Abdul Khalidβ€’ 70,180

@0xabdulkhalid

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


πŸ‘Ύ Hello, Frontend Mentor coding community.

This is my solution for the Product preview card component challenge.

A quick challenge with some customization.

🎨 I added some custom features:

  • Box-shadows
  • Intro animations using ScrollReveal.js

πŸ‘¨β€πŸ”¬ Follow me in my journey to finish all challenges (HTML/CSS/JS) to explore solutions that aspires everyone with custom features and tweaks

Ill be happy to hear any feedback and advice!

Community feedback

@VCarames

Posted

Hey there! πŸ‘‹ Here are some suggestions to help improve your code:

Love the animation, but unfortunately your content is not accessible.

  • 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 the background-image property, as it will not only let you use different images during different breakpoints it will let apply an alt tag description to image stating what the image is.

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

  • 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

  • The "shopping cart" icon πŸ›’ is decorative, so its alt tag should left blank and have an aria-hidden=β€œtrue” to hides it from assistive technology.
  • Implement a Mobile First approach πŸ“± > πŸ–₯

With mobile devices being the predominant way that people view websites/content. It is more crucial than ever to ensure that your website/content looks presentable on all mobile devices. To achieve this, you start building your website/content for smaller screen first and then adjust your content for larger screens.

More Info:πŸ“š

Mobile First

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

Happy Coding!πŸŽ„πŸŽ

Marked as helpful

3

Abdul Khalidβ€’ 70,180

@0xabdulkhalid

Posted

@vcarames

I really put a lot of thought into this, thank you for noticing.

I resolved that issue, do consider reviewing my solution once again to find any other issues

0

@VCarames

Posted

@0xAbdulKhalid

For this challenge, only one source is needed inside the picture element.

Your image needs an alt tag. Inside the alt tag should describe what the image is; they need to be readable. Assume you’re describing the image to someone.

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