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

Grid is way better than flexbox. All hail CSS-Grid.


Grid is not a replacement for Flexbox, it compliments it. Flexbox excels when you are only concerned with one dimension, grid excels when you're concerned with two (ie, a grid!) And yes, there is overlap.


They have many overlapping capabilities, but there are things flexbox can do which grid cannot. For instance, flexbox can wrap with dynamically sized children.


Got a citation for this?

I’ve seen this said, and for the life of me, I can’t find an actual reference for it.


Citation: Purely subjective personal experience / opinion.

At least it’s first-hand.


They solve different problems.


In general: Flex is for flowing content, grid is for structured. You can do some awesome wrapping with flex that is impossible with grid. Also `margin-inline-start: auto` is pretty rad using flex, although you can do something similar with `justify-self` with grid.

A good use case for flex would be a list of tags, that need to wrap.


Also harder to learn.




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

Search: