DEV Community

Cover image for Grid vs. Flex: A Tale of a "Simple" Promo Space

Grid vs. Flex: A Tale of a "Simple" Promo Space

Bryan Robinson on April 10, 2019

I love the new layout modes in CSS. Grid and Flexbox are both amazing features. They each have their place. What if I told you that if you used the...
Collapse
 
mutton profile image
Florian R. Klein

Eww, I really should have worked with grid instead of flexbox in my last progressive web app. Flexbox was quite a good fit for the job until one dirty (meaning: non-obvious) trick needed to be done to make it work out completely.

Collapse
 
technophile profile image
Vatsal Hirpara

Great post!

Collapse
 
brob profile image
Bryan Robinson

Thanks!

Collapse
 
jplindstrom profile image
Johan Lindstrom

I like it a lot, but I'm having an immense flashback to doing table based layouts right now. I can't help it.

Collapse
 
brob profile image
Bryan Robinson

It can definitely feel like that!

The big thing to think about is that table-based layouts were highly dependent on markup and the "containers" of the

nesting. So in a lot of ways it's actually closer to the mental model of flex and floats :D

Grid gives us sibling html and no nesting. Spanning elements on top of those inner margins is really nice break from how tables would have been too ;)

A lot of the outward mental model feels a bit like tables, but the inner workings are really nice