I am using the bootstrap 4 and wanted to know how I leave all the columns of the same height ? If possible without using flexbox to be compatible with older browser ( bah !).
Thank you
I am using the bootstrap 4 and wanted to know how I leave all the columns of the same height ? If possible without using flexbox to be compatible with older browser ( bah !).
Thank you
Use the first two solutions of this answer. The third solution involves a flexbox, but as you mentioned, you don't want that.
In case link doesn't work, here is 1st solution: (Use with caution)
.row {
overflow:hidden;
}
[class*="col-"]{
margin-bottom:-99999px;
padding-botton:99999px;
}
Solution 2: (Tables)
.row {
display:table;
}
[class*="col-"] {
float:none;
display:table-cell;
vertical-align:top;
}
Do you want the content of the columns to be equal height? Bootstrap 4's equal height cards can be used for this. This uses .display:table
and display:table-cell
when flexbox is not enabled
UPDATE
Now that Bootstrap 4 (alpha 6) is flexbox by default, the columns are always equal height: http://www.codeply.com/go/m20UAOFw79
Here is what you do if you want to use flexbox
The CSS
.row.is-flex {
display: flex;
flex-wrap: wrap;
}
.row.is-flex > [class*='col-'] {
display: flex;
flex-direction: column;
}
/*
* And with max cross-browser enabled.
* Nobody should ever write this by hand.
* Use a preprocesser with autoprefixing.
*/
.row.is-flex {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
}
.row.is-flex > [class*='col-'] {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
}
The html
<div class="row is-flex">
<div class="col-sm-4">...</div>
<div class="col-sm-4">...</div>
<div class="col-sm-4">...</div>
</div>
source (https://scotch.io/bar-talk/different-tricks-on-how-to-make-bootstrap-columns-all-the-same-height)