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

How to avoid empty space on flex container with wrapped contents?

$
0
0

screenshot

I have a simple input field that sits on a single line but wraps when there is not enough space, using CSS flexbox.

I would like to center this field, but when wrapped, it leaves empty space on the right.

It seems that below the wrapping point, it will always stretch to maximum width.

I would like to make it be as wide as its contents, so I can center it.

I have tried justify-contents: center, but that centers the label. I would like the input field to look exactly as in the screenshot, just centered.

Thank you!


Viewing all articles
Browse latest Browse all 1675

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>