3 ms·
They serve different purposes, and you'll often want to use both for different pieces of the layout. Flexbox is for laying things out in one dimension, Grid is
by Deimorz 8y ago
They serve different purposes, and you'll often want to use both for different pieces of the layout. Flexbox is for laying things out in one dimension, Grid is more for two-dimensional ones.
This video might help show the difference (and all the Layout Land videos are great if you want to look more into CSS grid): https://www.youtube.com/watch?v=hs3piaN4b5I https://www.youtube.com/watch?v=hs3piaN4b5I
- mephitix 8y agoI really don't get this argument. Not only is it easier IMO to layout things in one-dimension with CSS grid, but there are subtle bugs that occur on different platforms if you have Flexbox and Grid nested within each other. Just stick with Grid all the time and make your life easier.
- jazoom 8y agoI often use flexbox just for this: display: flex; justify-content: center; align-items: center;