<h1>ケース1 可変 × 固定</h1>
<div class="container">
  <div class="item"></div>
  <div class="item"></div>
</div>

<h1>ケース2 幅が変動してしまう</h1>
<div class="container">
  <div class="item">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</div>
  <div class="item"></div>
</div>

<h1>ケース3 [min-width: 0;] を指定</h1>
<div class="container container-long-text">
  <div class="item">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</div>
  <div class="item"></div>
</div>
.container {
    width: 300px;
    display: flex;
}

.item:nth-child(1) {
    flex: 1;
    word-wrap: break-word;
    background-color: #00a5e7;
}

.item:nth-child(2) {
    width: 100px;
    height: 50px;
    background-color: #fff001;
}

.container-long-text .item:nth-child(1) {
    min-width: 0;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.