Quantcast
Channel: Active questions tagged flexbox - Stack Overflow
Viewing all articles
Browse latest Browse all 1675

How to have a parent container shrink to fit contents, with a child that expands to a max-width [closed]

$
0
0

I want to have a parent container shrink to fit the contents of its children. This I've found is doable with either inline-block or inline-flex. I also want the children to be able to expand to a max-width, regardless of their content, which is where I'm having a problem.

It seems the two conditions are in conflict, as the child will not expand to the max-width in any scenario I try unless its contents allow it to. I simply want the child to take the maximum width it can and have the parent adjust accordingly.

Does anyone have any suggestions?


Viewing all articles
Browse latest Browse all 1675

Trending Articles