Product preview card component with BEM methodologic
Design comparison
Solution retrospective
Hello 👋.
This is my first project for Frontend Mentor.
I made it with BEM methodology.
For the layout i use Flexbox.
If anyone finds any mistakes, bugs or code improve, let me know.
Community feedback
- @correlucasPosted about 2 years ago
👾Hello @EidrianMax, Congratulations on completing this challenge!
Your solution its almost done and I’ve some tips to help you to improve it:
1.Its not so good that you used
overflow: hidden
for the whole content, in this case this property is making the content get cropped when the component gets tiny. Instead of usingoverflow
to make the rounded borders useborder-radius
for each card.2.To reduce your CSS file and improve the performance of loading your page you can use a tool called
CSS minify
that reduces the CSS code by removing the unnecessary characters. You can use aVSCode
plugin calledminify css
or this website tool to reduce your code:https://www.toptal.com/developers/cssminifier
👨💻Here's my solution for this challenge if you wants to see how I build it: https://www.frontendmentor.io/solutions/product-preview-card-vanilla-css-and-custom-hover-state-on-hero-85A1JsueD1
✌️ I hope this helps you and happy coding!
0 - @EidrianMaxPosted about 2 years ago
Hello @vcarames thank you for your feedback.
I will start to use em in media queries.
0 - @VCaramesPosted about 2 years ago
Hey @EidrianMax, congrats on your first challenge!
Some suggestions to improve you code:
-
The Alt Tag Description for the image needs to be improved upon. You want to describe what the image is; they need to be readable. Assume you’re describing the image to someone.
-
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.
-
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.
-
For media queries, I definitely suggest using em for them. By using px your assuming that every users browser (mobile, tablet, laptop/desktop) is using a font size of 16px (this is the default size on browser). Em's will help with users whose default isn't 16px, which can sometimes cause the your content to overflow and negatively affect your layout.
More Info:
https://betterprogramming.pub/px-em-or-rem-examining-media-query-units-in-2021-e00cf37b91a9
Happy Coding! 👻🎃
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