I am having some difficulty using Flexbox. The goal is to have a row that is the same height as the shortest child element. Take two images as examples, one has 200px height the other has 120px height. This example below works as intended when <img>
elements are the direct children of the flex element.
.row {
display: flex;
width: 100%;
background: orange;
}
<div class="row">
<img src="https://s3.amazonaws.com/imagetest.com/purple_200.jpg" />
<img src="https://s3.amazonaws.com/imagetest.com/teal_120.jpg" />
</div>
However, in the following example, the height of the flexbox element expands to the tallest child element:
.row {
display: flex;
width: 100%;
background: orange;
}
<div class="row">
<div class="col">
<img src="https://s3.amazonaws.com/imagetest.com/purple_200.jpg" />
</div>
<div class="col">
<img src="https://s3.amazonaws.com/imagetest.com/teal_120.jpg" />
</div>
</div>
What is a solution to make <div class="row">
the height of the shortest child element?