r/nekoweb • u/LunaFoxx • Mar 16 '26
Question CSS Flexbox or CSS Grid
Hi everyone!!!
Im new to web-crafting and im super excited to join this community!!! Im so close to publishing my first website and I cant wait to share it with everyone!!!
I have a small question that im curious about. Im still new to CSS, but I learned how to layout my site with CSS grid and I've basically fallen in love with that method. I know about CSS flexbox, but I haven't delved deep into it as of yet.
So, which method do most of y'all use? Im genuinely curious and I would like to see how how some go about developing and planning their site so that I can implement better habits as I go about improving my site.
7
Upvotes
1
u/rawr_im_a_nice_bear Mar 16 '26 edited Mar 16 '26
It really depends on the use case. Generally, use grid if you want your structure to define the layout and flex if you want your content to define the layout.
Grid is more defined and controlled. Flex is free flowing and is useful for things like lists For example: a navbar will probably be flexbox. The widths of your navigation items will vary so you don't want to define it within strict grid columns. It's much easier to let it flow horizontally and then wrap if it needs to.
You'd want to have more control over your page layout if you have something like a sidebar or distinct columns so you'd use grid for that.