I'm having trouble getting a group of images to stay within their container in a grid layout, as they're overflowing vertically beyond the container's boundaries.
Is there a way to adjust their size so they match the height of their parent element?
.images-container {
height: 70px;
background-color: blueviolet;
display: flex;
flex-direction: row;
justify-content: stretch;
}
.images-column {
display: flex;
flex-direction: column;
}
img {
width: 100%;
height: auto;
}
<div class="images-container">
<div class="images-column">
<img src="https://i.sstatic.net/mCwEU.png" />
<img src="https://i.sstatic.net/mCwEU.png" />
<img src="https://i.sstatic.net/mCwEU.png" />
<img src="https://i.sstatic.net/mCwEU.png" />
</div>
<div class="images-column">
<img src="https://i.sstatic.net/mCwEU.png" />
<img src="https://i.sstatic.net/mCwEU.png" />
<img src="https://i.sstatic.net/mCwEU.png" />
<img src="https://i.sstatic.net/mCwEU.png" />
</div>
</div>
I need the images to fit vertically inside the blue area and scroll horizontally if necessary.
For a live example, check out the stackblitz.