Product preview card ( Vanilla CSS + ScrollReveal.js )
Design comparison
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
- @VCaramesPosted almost 2 years ago
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 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 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 aspan
element with ansr-only class
that will state something like βThe previous price wasβ¦β and use CSS to make it only visible to screen readers.
More Info:π
- 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:π
If you have any questions or need further clarification, feel free to reach out to me.
Happy Coding!ππ
Marked as helpful3@0xabdulkhaliqPosted almost 2 years ago@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@VCaramesPosted almost 2 years ago@0xAbdulKhalid
For this challenge, only one
source
is needed inside thepicture
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 - 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
Please log in to post a comment
Log in with GitHubJoin 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