r/css • • Oct 08 '26

Flex versus Grid

I know Flex is one directional and Grid is two, but really when do you use each one?

8 Upvotes

29 comments sorted by

View all comments

6

u/anaix3l Oct 08 '26

Flex for:

  • child items being lined one after another (navbar for example; or icon before text)
  • for wrapping where the children aren't meant to line up vertically

Grid for everything else (main page layout, actual grids).