Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 8 months ago

Responsive product preview card using Flexbox

P
mpujazon•250
@mpujazon
A solution to the Product preview card component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

I’m proud to have used em and rem units for the first time — I think I’m finally getting it.

What challenges did you encounter, and how did you overcome them?

In the desktop version, I had an issue with the image showing white lines on the top and bottom, but I fixed it using max-height.

What specific areas of your project would you like help with?

When I use the code below to center the container/card, I run into an issue on smaller screens (like an iPhone SE). The card doesn't display properly — it's cut off at the top.

body{
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on mpujazon's solution.

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

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner
  • Use cases

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License