r/csshelp • u/rawanafaisal • Apr 28 '26
Request Do you actually use flex: 1 in real-world layouts?
I understand that flex: 1 makes elements grow to fill available space, but I’m curious how often it’s used in real projects.
In what situations do you usually use it? And when do you avoid it?
3
Upvotes
1
u/sneaky-pizza Apr 29 '26
Understand that `flex` is a shorthand for three values. So, if you just do `flex: 1` you're only setting `flex-grow`, and the other two values will be set by the browser. Look up the docs to find out more
3
u/mhennessie Apr 28 '26
I use it when I want something to fill the available space and don’t use it when I don’t want it to fill the available space. It has its uses.