Responsive product preview card component using HTML and CSS
Design comparison
Solution retrospective
I found issues with the way flexbox behaves while expanding or shrinking the explorer. Whats the best way to address this issue? I'd really appreciate any source to read you can recommend.
Community feedback
- @SinisaVukmirovicPosted almost 2 years ago
Hello!
About your question, to address that issue you could make a "media query" for more breakpoints, targeting the width on which your design has issues when shrinking.
But, you shouldn't stress about that. Only other developers can see those issues when shrinking. Ordinary users won't use developer tools, they are only on one screen size where they open your site.
Make it look good on screen sizes the challenge provides you with. That is good enough for these challenges. If you want to make it look "real site" good, than do more media queries breakpoints.
Marked as helpful0 - @VCaramesPosted almost 2 years ago
Hey there! 👋 Here are some suggestions to help improve your code:
- Since the images in this component add value and serve a purpose (displaying the product), it is best to use the
Picture
element and not thebackground-image
property, as it will to use different images during different breakpoints.
- The only heading in this component, is the name of the perfume; “Gabrielle Essence Eau De Parfum” . The rest of the text should be wrapped in a
paragraph
element.
- 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:📚
If you have any questions or need further clarification, feel free to reach out to me.
Happy Coding!🎄🎁
Marked as helpful0 - Since the images in this component add value and serve a purpose (displaying the product), it is best to use the
- @jjfuentes13Posted almost 2 years ago
I also had issues with flexbox and eventually learned grid and used that. The only one I used flex was for the price div. Using a grid did eliminate the shrinking and expanding depending on the resolution size.
Marked as helpful0
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