I'm in the process of designing a card with two stacked divs. The upper section of the card contains an image, while the lower part consists of text. How can I ensure that both the top and bottom divs have equal heights? I am hesitant to specify fixed pixel heights for the divs as I do not know how much text will be on the other cards.
.card {
display: flex;
flex-direction: column;
flex: 1;
}
.cardTop, .cardBottom {
border: 1px solid;
}
img {
display: block;
}
<div class="card">
<div class="cardTop">
<img src="https://placehold.it/200x100" alt="">
</div>
<div class="cardBottom">
<p>text of the card goes here</p>
</div>
</div>