I'm using Bootstrap. How can I make three columns all the same height?
Here is a screenshot of the problem. I would like the blue and red columns to be the same height as the yellow column.
Here is the code:
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container-fluid">
<div class="row">
<div class="col-xs-4 panel" style="background-color: red">
some content
</div>
<div class="col-xs-4 panel" style="background-color: yellow">
catz
<img width="100" height="100" src="https://lorempixel.com/100/100/cats/">
</div>
<div class="col-xs-4 panel" style="background-color: blue">
some more content
</div>
</div>
</div>
I know I'm very late but now you can use the "min-height" style attribute to achieve your purpose.
Best out there:
Github reflex - Docs
Works with bootstrap
Update:
where .container-height is the style class that has to be added to a .row styled element to which all its .col* children have the same height.
Applying these styles only to some specific .row (with .container-height, as in the example) also avoids applying the margin and padding overflow to all .col*.
I tried alot of the suggestions made in this thread and on other pages but no solution worked 100% in every browsers.
So I experimented quite some time and came up with this. A complete solution for Bootstrap Equal Height columns with the help of flexbox with only 1 class. This works in all major browsers IE10+.
CSS:
HTML:
To support even more versions of IE you can, for example, use https://github.com/liabru/jquery-match-height and target all child columns of
.equal-cols
. Like this:Without this polyfill the columns will behave as usual Bootstrap columns so which is a quite good fallback.
For those looking for a quick, easy solution - if you have a relatively consistent set of block content setting a min-height on the div that is a bit bigger than the largest block can be easier to implement.
I searched for a solution to the same problem, and found one just worked !! - with almost no extra code..
see https://medium.com/wdstack/bootstrap-equal-height-columns-d07bc934eb27 for a good disuccuion, and with the resposne you want in the bottom, with a link.
https://www.codeply.com/go/EskIjvun4B
this was the correct responsive way to for me... a quote: ... 3 — Use flexbox (best!)
As of 2017, the best (and easiest) way to make equal height columns in a responsive design is using CSS3 flexbox.
and simply use: