Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using twitter bootstrap 2.0 - How to make equal column heights?

Does bootstrap 2.0 have any helpers to make .span1, .span2 .... .span12 equal height. I've nested this type of html

<div class='container'>   <div class='row'>     <div class='span2'>       <div class='well'>         XXXX       </div>     </div>     <div class='span2'>       <div class='well'>         XXXX         XXXX       </div>     </div>     <div class='span2'>       <div class='well'>         XXXX         XXXX         XXXX       </div>     </div>   </div> </div> 

I would like each well to end up the same height if possible?

like image 324
bradgonesurfing Avatar asked Feb 04 '12 19:02

bradgonesurfing


People also ask

How do I make two columns equal height in bootstrap?

You should be using a custom selector for one and two the tables styles should not be applied to [class*='col-'] that have defined widths. This method should ONLY be used if you want equal height AND equal width columns. It is not meant for any other layouts and is NOT responsive.

How do you make all col the same height?

As of 2017, the best (and easiest) way to make equal height columns in a responsive design is using CSS3 flexbox. Now we have columns that are equal in height, and their content fills the full height ot the entire column.

How can I make bootstrap 4 columns all the same height?

3 Answers. Show activity on this post. You just have to use class="row-eq-height" with your class="row" to get equal height columns for previous bootstrap versions.

How do I make a div the same height in a row?

Answer: Use the CSS3 flexbox With CSS3 flex layout model you can very easily create the equal height columns or <div> elements that are aligned side by side. Just apply the display property with the value flex on the container element and the flex property with the value 1 on child elements.


1 Answers

Here's a responsive CSS solution, based on adding a large padding and an equally large negative margin to each column, then wrapping the entire row in in a class with overflow hidden.

.col{     margin-bottom: -99999px;     padding-bottom: 99999px;     background-color:#ffc; }  .col-wrap{       overflow: hidden;    } 

You can see it working at jsFiddle

Edit

In response to a question, here's a variation if you need equal height wells or equal height columns with rounded corners: http://jsfiddle.net/panchroma/4Pyhj/

Edit

In response to a question, here's the same technique in Bootstrap 3, same principle, just update the class names in the Bootstap grid: http://jsfiddle.net/panchroma/bj4ys/embedded/result/

like image 82
David Taiaroa Avatar answered Oct 11 '22 09:10

David Taiaroa