I want to have the first two columns of both rows (green and violet) always having the same height. I hoped for using d-flex align-items-stretch
but it seems like it doesn’t work because those two elements are not in the same row/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’m stuck here for a while, I might can’t think straight. Can someone confirm why align-items-stretch doesn’t work and maybe help me out on this one?
Full Demo: https://jsfiddle.net/2gz7bmrf/1/
2
Answers
I guess my only solution is to restructure my code and use order-md-n.
https://jsfiddle.net/myepfo52/
You have to put the 2 align div in same parent.