So I've been looking around for a solution to this and I cannot find one anywhere.
I've tried flex-grow: 1;
, align-self: stretch;
and a few other flexbox
properties but none seem to do the trick.
I would like to get the last column to stretch and take up the remaining height from the row.
Following what everyone has said I've made some adjustments, still not quite what I need it to be however.
(The blue box is what I want to stretch)
View the below snippet:
.product {
border: 1px solid rgba(0,0,0,.2);
padding: 15px;
height: 100%;
}
.product .image {
padding-bottom: 100%;
background: rgba(255,0,0,.2);
margin-bottom: 15px;
}
.product .content {
border: 1px solid blue;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row">
<div class="col-4">
<div class="product">
<div class="image"></div>
<div class="content">
The height of this is dynamic.
</div>
</div>
</div>
<div class="col-4">
<div class="product">
<div class="image"></div>
<div class="content">
It can vary from product to product, but I would like this class to stretch.
</div>
</div>
</div>
<div class="col-4">
<div class="product">
<div class="image"></div>
<div class="content">
To fill the rest of the columns height.
</div>
</div>
</div>
</div>
</div>