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

Product preview card component with pure css and picture tag

@dev-feriansyah

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


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

Creating Equal-Width Flexbox Children

I learned that to make flexbox children have equal widths, using the shorthand flex: 1 1 50% is effective. Initially, I thought that simply using flex: 1 would suffice, as it sets flex-basis: 0% and flex-grow: 1, which should theoretically give each element equal width. However, when rendered, the image section ended up being 268px (44.67%), while the content section was 332px (55.33%), instead of both being 300px. This taught me that specifying the correct flex-basis (e.g., 50%) is crucial for achieving the desired equal-width layout when working with image.

Community feedback

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