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 using flexbox

Buci 40

@alphardhafiz

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


how the best practice in this case? use grid or flexbox?

Community feedback

@kevin3080

Posted

As the project is, it is more recommended to use flexbox. When we describe flexbox as one dimensional we highlight the fact that flexbox handles layout in only one dimension at a time — either as a row or as a column. This contrasts with the two-dimensional model of the CSS Grid Layout, which controls columns and rows at the same time.

The display: grid statement gives you a single column grid, so your elements continue to display one below the other, as they do in the normal flow. To see something that looks more like a grid, we need to add columns to the grid.

Marked as helpful

0

@alimuddinhasan

Posted

Since the product detail section needs the flexibility to arrange the element, I recommend you to use flexbox. You can use default flex direction for outer section and use column for product detail section.

Marked as helpful

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