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

Responsibe Preview product

@hectorjbd

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


It was difficult for me to place two div next to each other. I didn't know which one to use: grid or flex

Community feedback

jerry 320

@realsale

Posted

Yo! Hector,

Both flex and grid can achieve the same layout.

  • in flex you can simply set the containers display property to flex, and it will layout the flex-items(children) side-by-side(horizontally), that is because of flex-direction: row which is a default property value in flex container.
  • while in grid you need to set the containers display property to grid and also specify how many columns you want your grid should have using grid-template-columns, it can be also be used to specify the size(width) of the column.

Marked as helpful

0
Nurcholis 420

@cholis04

Posted

Hi Hector Brito, You did a good job!

Flex can be used for alignment on one axis, horizontally or vertically. But Grid can do alignment on both, vertical and horizontal.

And to improve accessibility you should wrap the main content with the <main> tag.

Marked as helpful

0

@hectorjbd

Posted

It was difficult for me to place two div next to each other. I didn't know which one to use: grid or flex

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