Responsive Product Card (Mixing CSS variables, flex and gid)
Design comparison
Solution retrospective
"newbie here" First time using CSS variables and the global resets and also first time completely avoiding using pixels and fixed sizes (lot of googling and youtube , but tried to it without looking back)
There was a part (commented on the css code) related to the .product class on media query where a white space kept appearing under my img when switching to two column layout , if someone can help me understand why . Tried grid and flex but both when i hit a certain width there is a white space under the image then few pixel(width) later it disapear .
Community feedback
- @fernandolapazPosted over 1 year ago
Hi 👋,
- Regarding your question, try this:
.product__img img { height: 100%; }
And I take the opportunity for another comment if you don't mind:
- It is better to use
min-height: 100vh;
for the body, as usingheight
causes the page to be cut off in viewports with small height (such as mobile landscape orientation).
And please let me know if it worked 🙂
Regards,
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