2

I am new to bootstrap. I am using three columns with class span4 each to show some highlighted content. The boxes are with background color and a solid border. How do I set the height of all the three columns to the max height column among three?

<div class="row grid-row">
 <div class="span4">
  <div class="widget-header">
    <h3>Tutoring &amp; Training Centers</h3>
  </div>
  <div class="widget-body">
    <p>World’s leading tutoring centers use to create custom diagnostic analysis to improve student performance, increase efficiency, and grow customer base.</p>
<p class="center"></p>
  </div>
 </div>
 <div class="span4">
  <div class="widget-header">
    <h3>Tutoring &amp; Training Centers</h3>
  </div>
  <div class="widget-body">
    <p>World’s leading tutoring centers use to create custom diagnostic analysis to improve student performance.</p>
<p class="center"></p>
  </div>
 </div>
 <div class="span4">
  <div class="widget-header">
    <h3>Tutoring &amp; Training Centers</h3>
  </div>
  <div class="widget-body">
    <p>World’s leading tutoring centers use to create custom diagnostic .</p>
<p class="center"></p>
  </div>
 </div>
</div>

I have attached a screen short for refrense.

enter image description here

ggorlen
  • 44,755
  • 7
  • 76
  • 106
Umar Adil
  • 5,128
  • 6
  • 29
  • 47

3 Answers3

1

There will be an official experimental example of same-height columns using CSS flexbox in Bootstrap v3.2.0. Here's the gist of it:

.row-eq-height {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
}

And then use <div class="row row-eq-height"> instead of <div class="row">.

Note the flexbox isn't supported in IE<10.

cvrebert
  • 9,075
  • 2
  • 38
  • 49
0

With jQuery

var maxHeight = 0;

$("div").each(function(){
   if ($(this).height() > maxHeight) { maxHeight = $(this).height(); }
});

$("div").height(maxHeight);

With CSS

Also check out: How to create equal height columns in pure CSS

Community
  • 1
  • 1
Chankey Pathak
  • 21,187
  • 12
  • 85
  • 133
0

This will help you

Html :

<div class="main">
    <div class="box">a</div>
    <div class="box">b</div>    
    <div class="box" style="height:100px;">c</div>  
</div>

Css :

.main{
    height:auto;
    display:table;

}
.box{
    height:100%;
    width:80px;
    display:table-cell;
    background:gray;
    border:1px solid red
}

Demo

Amit
  • 1,841
  • 1
  • 19
  • 36