I have a form
with a single input
tag sitting inside of a div
. I'm trying to have the form
/input
respect the width of the parent, but I can't seem to make it react to flexbox -- it just decides its own width and overflows the container.
HTML
<div class="container">
<span>foo</span>
<span>bar</span>
<form>
<input value="baz"/>
</form>
</div>
CSS
.container {
display: flex;
width: 150px;
border: 1px solid black;
}
Screenshot
What I would expect is that the flexbox setting on the parent div would shrink the form to fit inside of its width, but this isn't happening. Instead, the form
/input
just sits at its desired width and doesn't shrink down, even if I set flex-shrink
on it.