I have a created a grid/box/card layout using flexbox so all items are all same heights. The layout has 4 boxes each row. This particular grid only has content/text in them so I am trying to make all the inner elements which all heading tags also of same height but I am failing to do so. I have researched a lot and tried all the different options provided in these examples but it just does not work. The issue is any row within one grid or box can be of any height as content entered is dynamic and I have no control over it
That is what I am trying to do so, Now if the content in yellow row of first box is more than that of the second box, then the yellow row of 2nd,3rd,4th boxes should resize to that of the 1st box. The boxes in the first row of of the grid do resize to the equal heights but the rows within the boxes would not and so blue and green rows of other boxes move up leaving a gap at the end of the box
Code Snippet:
.flexi-container {
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
flex-wrap: wrap;
}
.left {
float: left;
}
.col-100 {
width: 100%;
}
.pos-rel {
position: relative;
}
.grid-text-item {
width: 20%;
margin-right: 1%;
margin-bottom: 1%;
background-color: #fff;
border: 1px solid #ddd;
flex-direction: column;
flex: 1;
}
<div style="width:100%;margin:0 auto;position:relative;">
<div class="grid-text-container flexi-container pos-rel col-100 left">
<div class=" grid-text-item pos-rel left flexi-container">
<!-- <div class="grid-text-content pos-rel flexi-item left">-->
<!-- <a class="full-link" href=""></a>-->
<h2 class="col-100">Name</h2>
<h3 class="col-100">Address,Address,Address,Address,Address</h3>
<h4 class="col-100">
<span class="block-element">123456</span>
<span class="block-element">email@email.com</span></h4>
<h6 class="col-100">Subtext</h6>
</div>
<div class=" grid-text-item pos-rel left flexi-container">
<!-- <div class="grid-text-content pos-rel flexi-item left">-->
<!-- <a class="full-link" href=""></a>-->
<h2 class="col-100">Name</h2>
<h3 class="col-100">Address,Address,Address,Address,Address</h3>
<h4 class="col-100">
<span class="block-element">123456</span>
<span class="block-element">email@email.com</span></h4>
<h6 class="col-100">Subtext</h6>
</div>
<div class=" grid-text-item pos-rel left flexi-container">
<!-- <div class="grid-text-content pos-rel flexi-item left">-->
<!-- <a class="full-link" href=""></a>-->
<h2 class="col-100">Name</h2>
<h3 class="col-100">Address,Address,Address,Address,Address</h3>
<h4 class="col-100">
<span class="block-element">123456</span>
<span class="block-element">email@email.com</span></h4>
<h6 class="col-100">Subtext</h6>
</div>
<div class=" grid-text-item pos-rel left flexi-container">
<!-- <div class="grid-text-content pos-rel flexi-item left">-->
<!-- <a class="full-link" href=""></a>-->
<h2 class="col-100">Name Name Name Name Name</h2>
<h3 class="col-100">AddressAddress,Address,Address,Address,Address,Address</h3>
<h4 class="col-100">
<span class="block-element">123456</span>
<span class="block-element">email@email.com</span></h4>
<h6 class="col-100">Subtext</h6>
</div>
<div class=" grid-text-item pos-rel left flexi-container">
<!-- <div class="grid-text-content pos-rel flexi-item left">-->
<!-- <a class="full-link" href=""></a>-->
<h2 class="col-100">Name</h2>
<h3 class="col-100">Address,Address,Address,Address,Address</h3>
<h4 class="col-100">
<span class="block-element">123456</span>
<span class="block-element">email@email.com</span></h4>
<h6 class="col-100">Subtext</h6>
</div>
<div class=" grid-text-item pos-rel left flexi-container">
<!-- <div class="grid-text-content pos-rel flexi-item left">-->
<!-- <a class="full-link" href=""></a>-->
<h2 class="col-100">Name</h2>
<h3 class="col-100">Address,Address,Address,Address,Address,Address,Address</h3>
<h4 class="col-100">
<span class="block-element">123456</span>
<span class="block-element">email@email.com</span></h4>
<h6 class="col-100">Subtext</h6>
</div>
<div class=" grid-text-item pos-rel left flexi-container">
<!-- <div class="grid-text-content pos-rel flexi-item left">-->
<!-- <a class="full-link" href=""></a>-->
<h2 class="col-100">Name</h2>
<h3 class="col-100">Address,Address,Address,Address,Address</h3>
<h4 class="col-100">
<span class="block-element">123456</span>
<span class="block-element">email@email.com</span></h4>
<h6 class="col-100">Subtext</h6>
</div>
<div class=" grid-text-item pos-rel left flexi-container">
<!-- <div class="grid-text-content pos-rel flexi-item left">-->
<!-- <a class="full-link" href=""></a>-->
<h2 class="col-100">Name</h2>
<h3 class="col-100">Address,Address,Address,Address,Address</h3>
<h4 class="col-100">
<span class="block-element">123456</span>
<span class="block-element">email@email.com</span></h4>
<h6 class="col-100">Subtext</h6>
</div>
<div class=" grid-text-item pos-rel left flexi-container">
<!-- <div class="grid-text-content pos-rel flexi-item left">-->
<!-- <a class="full-link" href=""></a>-->
<h2 class="col-100">Name</h2>
<h3 class="col-100">Address,Address,Address,Address,Address</h3>
<h4 class="col-100">
<span class="block-element">123456</span>
<span class="block-element">email@email.com</span></h4>
<h6 class="col-100">Subtext</h6>
</div>
</div>
</div>
I am not a very advance user of flexbox and am in initial stages
Thank you very much for any help.