@realsale
Posted
Yo! Hector,
Both flex
and grid
can achieve the same layout.
- in
flex
you can simply set the containersdisplay
property toflex
, and it will layout theflex-items
(children) side-by-side(horizontally), that is because offlex-direction: row
which is a default property value inflex
container. - while in
grid
you need to set the containersdisplay
property togrid
and also specify how many columns you want yourgrid
should have usinggrid-template-columns
, it can be also be used to specify the size(width) of the column.
Marked as helpful