The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › A simple layout component: flex or grid?
So, I want to do a simple component with a one direction layout. What should I use: Flexbox or CSS Grid? Why?
Is just a preference or there are pros and cons?
Check this super simple example: https://codepen.io/joaosaro/pen/rRJXOa
A container with 3 children: two divs occupying only the content size and one that expands itself the maximium space possible.
Both tools will work, but personally I lean towards flexbox because it has better support in IE11 (if you still care about IE11 support).
I forgot to mention: if there is no browser support issues.
My doubt is if there is anyone that found any technical advantage from one to the other. Or is just a question of readibility or approach (1D vs 2D)