Below is the functional code:
.container{
display: flex;
background-color: lightgreen;
justify-content: center;
alighn-item: center;
}
.child{
margin-left: 10px;
height: 200px;
background-color: yellow;
display: flex;
flex-direction: column;
flex-wrap: wrap;
}
.childItem{
height: 50px;
width: 100px;
background-color: red;
display: flex;
justify-content: center;
align-items: center;
margin: 10px 0 0 10px;
}
<div class='container'>
<div>Test</div>
<div class='child'>
<div class="childItem">Amounts</div>
<div class="childItem">Amounts</div>
<div class="childItem">Amounts</div>
<div class="childItem">Amounts</div>
<div class="childItem">Amounts</div>
</div>
</div>
Current output
https://i.sstatic.net/7H8cQ.png
Expected output
https://i.sstatic.net/fzR3g.png
The child container (yellow) width should match the child item (red) elements