I am trying to achieve equal row height for bootstrap class using container, row and col-sm-4. Initially, I asked a Question which was marked as a duplicate. However, I am finding that there is a problem with the solutions provided.
The problem is that, in a normal three col-sm-4 situation, I get 3 rows in big screen and exactly one row when I reach the 'breakpoint'. However, the provided solution (JSFiddle) breaks that rule. Depending on the screen size, I sometimes get 1, 2, 3 or even 4 columns based on the screen size as shown in the image below.
How can I achieve equal height while maintaining the standard behaviour for bootstrap?
<div class="container">
<div class="row">
<div class="col-sm-4">
Row 1 Col 1
</div>
<div class="col-sm-4">
This is some long tex that has a greater height than the rest
</div>
<div class="col-sm-4">
Row 1 Col 3
</div>
<div class="col-sm-4">
Row 2 Col 1
</div>
<div class="col-sm-4">
Row 2 Col 2
</div>
<div class="col-sm-4">
Row 3 Col 3
</div>`
</div>
</div>
// css
@import url('//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css');
body {
margin: 10px;
}
.row {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
flex-wrap: wrap;
}
.row > [class*='col-'] {
display: flex;
flex-direction: column;
}