Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For anyone unsure whether to use flex or grid, the mental shorthand that I use is whether the container or the elements in a container should have more control over the layout.

I guess I’m wondering why it’s any more complicated than:

* Flexbox is for formatting in one dimension (or axis)—a row or a column.

* Grid is for layout in 2-dimensions—columns and rows; a.k.a. a grid.

In fact, you can use flexbox and grid in the same layout, each doing its thing.



What I'd add your summary: Flex wrapping is a different kind of 2-dimension behavior than a grid, but they're both useful 2 dimensional layout behaviors.

In fact, you can use flexbox and grid in the same layout, each doing its thing.

100% At 17:30 near the end of that video I linked is an example of mixing them.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: