I'm struggling way more than I should with this. I can't fit a 30x30px <button>
in this flex
container; it's overflowing over the red border. My attempts so far have been with making sure the button is properly set, but maybe it's related to the input taking a default width that flex
just ignores.
.container {
width: 200px;
border: solid 1px red;
box-sizing: border-box;
}
.flex {
display: flex;
gap: 10px;
width: 100%;
}
input {
flex: 1;
}
button {
flex: 0 0 30px;
height: 30px;
aspect-ratio: 1;
}
<div class="container">
<div class="flex">
<input type="text">
<button>X</button>
</div>
</div>