r/csshelp • u/OneBeautifulDog • Oct 27 '21
Flex question
Trying to divide up a div horizontally that creates equal divs using flex.
Stack has only floats. I tried flex but it doesn't work.
1
u/mhennessie Nov 06 '21
Try adding flex:1 to the children of the flex container
1
u/OneBeautifulDog Nov 06 '21
That's what I have. Since flex is collapsible, if you don't have anything in the box, then it collapses all the way and you have nothing. I wanted blank boxes, responsive, but with some width. I can't use px.
1
u/mhennessie Nov 06 '21
Is there a fixed number of boxes? If so width: calc(100% / # ) where # is the number of boxes.
1
1
u/OneBeautifulDog Nov 06 '21
I tried it and I see how it worked.
How would you do it if you didn't want even spacing between columns but you still wanted it responsive fr?
1
u/Helpful-Sea-9815 Oct 27 '21
Is this what you are trying to achieve?