Simply make the container a grid one to have all the elements inside the same column and have the same width:
.outer-container {
width: 200px;
overflow: auto;
display:grid;
}
.grid-container {
display: grid;
grid-template-columns: minmax(200px, 3.5fr) minmax(80px, 1fr);
padding-top: 16px;
padding-bottom: 16px;
}
.grid-underline {
border-top: 2px solid green;
}
.item {
background-color: pink;
}
<div class="outer-container">
<div class="grid-container">
<div class="item">helllo</div>
<div class="item">world</div>
</div>
<div class="grid-underline"></div>
</div>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…