Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 1 year ago

Product card preview with flexbox

bem
David Sibrian•390
@armson45
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 think I've improved the class naming and a little bit of structure.

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

On the right side of the card (pc view) I tried to separate the elements with:

  • grid: I had the problems of some rows being higher than others. I tried the grid-template-rows: max-content max-content 75px 50px (not the exact values) and run into some problems so I tried the next.
  • flexbox: I think that a gap will be fine :) but i think is not a good way.
  • margins: Tried putting margin-top in every element on the right side, kinda worked but I didn't like so I kept the gaps.
What specific areas of your project would you like help with?

I absolutely think that there is a better way to do what I did on the right side...I'll appreciate if you take a look on the code and tell me a way to improve it.

Also, to make the image borders look rounded I used overflow: hidden, also I don't know if that's a good way.

Thank you in advance! :)

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 David Sibrian'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