In my Bootstrap 4 layout, I have set up two columns...
- The left column contains three cards in columns
- The right column has a list group
The content in the list group is longer than that of the cards on the left side.
Is there a way to make the height of the list group's container match the adjacent column with the three cards using Bootstrap?
Currently, I am using CSS max-height
, but I feel this might not be the best way forward.
https://i.sstatic.net/rUk3r.png
<!-- 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 content.
</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 content
</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 content
</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 content
</div>
</div>
Note: The cards use .card-img-overlay and maintain dimensions similar to the image inside.