Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Responsive Product Card (Mixing CSS variables, flex and gid)

@AkramLah

Desktop design screenshot for the Product preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

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

Fer 3,970

@fernandolapaz

Posted

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 using height 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 GitHub
Discord logo

Join 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