- This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
I’ve been struggling trying to do this. Is there a way to make the flexbox container shrinkwrap its contents – for example, like display: table;
does?
I have no idea what you mean but if you mock something up for us in a CodePen demo – include a basic flexbox and display:table;
sample side-by-side to show us what you mean – we can offer suggestions.
Sure there is…display:inline-flex
OOHH.. NICE. Didn’t know that one either. Thanks Paulie_D
Thanks. That did the trick because I happen to have only one inline-flex
container in the parent block, but the problem in general is that it will stack containers side-to-side instead of vertically. I don’t suppose there’s a way to avoid that?
Not really, inline-flex
works the same way as any other inline
element, span
, inline-block
, inline-table
etc.
If you want more than one “container” you may have to think about how you are structuring your HTML.