I have the following Bootstrap 4 layout, which uses two columns...
- Left column, containing three cards-in-columns
- Right column, containing a list group
The contents of the list group are longer than the contents of the three cards in the left-hand-side.
How can I use Bootstrap to limit the height of the list group's container to match the height of the adjacent column which contains three cards?
Right now, I have used CSS max-height
, but this is not a suitable way for me to proceed.
<!-- Left column -->
<div class="col-12 col-sm-7 col-md-8 col-lg-8 col-xl-9">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-4 pb-4">
<a href="#" class="card bg-dark text-white shadow-sm border-0 card-overlay" target="_blank">
First card is here.
</a>
</div>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 col-xl-4 pb-4">
<a href="#" class="card bg-dark text-white shadow-sm border-0 card-overlay" target="_blank">
Second card is here
</a>
</div>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 col-xl-4 pb-4">
<a href="#" class="card bg-dark text-white shadow-sm border-0 card-overlay" target="_blank">
Third card is here
</a>
</div>
</div><!-- end .row -->
</div><!-- end Left column -->
<!-- Right column -->
<div class="col-12 col-sm-5 col-md-4 col-lg-4 col-xl-3 d-none d-sm-block" style="max-height: 725px; overflow-y: scroll;">
<div class="list-group list-unstyled">
List group is here
</div>
</div>
NB. the cards use .card-img-overlay and their dimensions remain the same as those of the image used inside.