I am trying to get my flex items to shrink. As soon as I wrap the buttons (which do get smaller with correct overflow behavior) in an additional element, the buttons don' get smaller. I really can't understand why. Any help is appreciated!
button {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.breadcrumb-item {
border: 1px dotted blue;
display: flex;
}
.breadcrumb-wrapper {
display: flex;
border: 1px solid black;
}
.outer-container {
border: 1px solid pink;
width: 25%;
}
<h2>This does not work!</h2>
<div class="outer-container">
<div class="breadcrumb-wrapper">
<div class="breadcrumb-item">
<button type="button">This button should shrink according to parent</button>
</div>
<div class="breadcrumb-item">
<button type="button">This too</button>
</div>
<div class="breadcrumb-item">
<button type="button">This also</button>
</div>
</div>
</div>
<h2>But this does!</h2>
<div class="outer-container">
<div class="breadcrumb-wrapper">
<button type="button">This button should shrink according to parent</button>
<button type="button">This too</button>
<button type="button">This also</button>
</div>
</div>