I am trying to make a button stick to the bottom of a card no matter how much content is on it. I used the Bootstrap class mt-auto, which worked well. However, when I set the height of all divs to 100%, the row in the card body overflows from the lg breakpoint when columns have the class col-12. Can someone help me figure out why this is happening? Why isn't the height set to 100% of the parent div?
Here is a code example with a demo:
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet"/>
<div class="row mx-0 gy-4">
<div class="col-12 d-flex col-md-6">
<div class="card bg-info">
<div class="card-body h-100 position-relative">
<div class="row mx-0 h-100">
<div class="px-0 col-12 col-lg-6 mb-3 text-center" style="height: 200px">
<img class="img-fluid" src="https://placekitten.com/250/462" style="height: 100%"/>
</div>
<div class="col-12 px-0 d-flex flex-column col-lg-6 h-100">
<p>Lorem ipsum dolor Lorem ipsum dolor Lorem ipsum dolor Lorem ipsum dolor Lorem ipsum dolor Lorem ipsum dolor Lorem ipsum dolor Lorem ipsum dolor Lorem ipsum dolor Lorem ipsum dolor Lorem ipsum dolor Lorem ipsum dolor Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</p>
<button class="btn btn-primary w-auto mt-auto">Watch more</button>
</div>
</div>
</div>
</div>
</div>
<div class="col-12 d-flex col-md-6">
<div class="card bg-info">
<div class="card-body h-100 position-relative">
<div class="row mx-0 h-100">
<div class="px-0 col-12 col-lg-6 mb-3 text-center" style="height: 200px">
<img class="img-fluid" src="https://placekitten.com/250/462" style="height: 100%"/>
</div>
<div class="col-12 px-0 d-flex flex-column col-lg-6 h-100">
<p> Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</p>
<button class="btn btn-primary w-auto mt-auto">Watch more</button>
</div>
</div>
</div>
</div>
</div>
</div>