Product preview card component using CSS, Flexbox
Design comparison
Solution retrospective
Hello there,
This is my #4 challenge π Is there anything I could optimize in my code? Any feedback is greatly appreciated π
Thank you for reviewing my code, I am happy to hear any suggestions! π
Claire
Community feedback
- @VCaramesPosted about 2 years ago
Hey there! π Here are some suggestions to help improve your code:
Cool animation!!
-
Remove the aria-hidden=βtrueβ and give the Alt Tag a description. This image add value. It is not just for decoration purposes.
-
The old price π· is not being announced properly to screen readers. You want to wrap it in a Del Element and include a sr-only text explaining that this is the old price.
If you have any questions or need further clarification, let me know.
Happy Coding! π»π
Marked as helpful0@ClaireKarsentiPosted about 2 years agoHello @vcarames,
Thank you for reviewing my code π
I just push my new version on my gitHub :rocket:
So as you suggested I removed the aria-hidden and gave the alt tag to the img. The use of the aria-hidden and the alt is very clear for me now. Finally, I wrapped the initial price in a del element, which I added it a "sr-only" class with a display: none property in the css, hopefully that what I was supposed to do.
π
0 -
- @correlucasPosted about 2 years ago
πΎHello @ClaireKarsenti, Congratulations on completing this challenge!
Great code and great solution! Iβve few suggestions for you that you can consider adding to your code:
1.Add the website favicon inserting the svg image inside the
<head>
.<link rel="icon" type="image/x-icon" href="./images/favicon-32x32.png">
2.Its really nice that youβve used some animation and effects! Something to improve the accessibility its to add a media query reducing the motion.The prefers-reduced-motion CSS media feature is used to detect if the user has requested that the system minimize the amount of non-essential motion it uses. Hereβs the code for that:
/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */ @media (prefers-reduced-motion: reduce) { html:focus-within { scroll-behavior: auto; } *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } }
βοΈ I hope this helps you and happy coding!
Marked as helpful0@ClaireKarsentiPosted about 2 years agoHello @correlucas,
Thank you for your suggestions π
I don't understand why I need to add to my code this svg image, what is it use for ? Anyway, as suggested for the animation I updated my code to improve the accessibility by adding the media query that you mentioned.
π
0
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