I am trying to ensure that the first two columns in both the green and violet rows always have the same height. I initially thought of using d-flex align-items-stretch
, but it seems like it is not working because those elements are not within the same row or parent element.
<div class="container">
<div class="row" style="background-color:yellow;">
<div class="col-6">
<div class="row">
<div class="col-12 d-flex align-items-stretch" style="background-color:green;">A1</div>
<div class="col-12" style="background-color:blue;">A2</div>
<div class="col-12" style="background-color:red;">A3</div>
</div>
</div>
<div class="col-6">
<div class="row">
<div class="col-12 d-flex align-items-stretch" style="background-color:violet;">B1</div>
<div class="col-12" style="background-color:orange;">B2</div>
<div class="col-12" style="background-color:gray;">B3</div>
</div>
</div>
</div>
</div>
I have been struggling with this for some time now, and I might be missing something obvious. Can someone explain why align-items-stretch is not working and possibly assist me with a solution?
Check out the full demo here: https://jsfiddle.net/2gz7bmrf/1/