Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make Bootstrap 4 columns all the same height? [duplicate]

Disclaimer. This question was asked many times before. But since time has passed and now we are close to Bootstrap 4 release with full flexbox support, it is time for new answers for the same question.

I want to create equal column height with Bootstrap 4. Here is demo of intended result:

I want a solution, that works in all browsers, that are supported by Bootstrap 4. Better if no JS involved. Some of existing solution are based on Bootstrap 3, some aren't working in Safari on MacOS.

Update. Seems I did wrong research. Bootstrap 4 ships with equal height by default. I have included an updated image with illustration. You don't need to do anything, it is already there.

like image 907
dandaka Avatar asked Mar 02 '17 09:03

dandaka


People also ask

How do I make Bootstrap 4 columns equal height?

You just have to use class="row-eq-height" with your class="row" to get equal height columns for previous bootstrap versions.

How do you make Bootstrap all your cards the same height?

To get it to the same height, add Bootstrap class h-100 to all the cards or use CSS height.

How do I keep my divs the same height?

The two or more different div of same height can be put side-by-side using CSS. Use CSS property to set the height and width of div and use display property to place div in side-by-side format. The used display property are listed below: display:table; This property is used for elements (div) which behaves like table.


2 Answers

You just have to use class="row-eq-height" with your class="row" to get equal height columns for previous bootstrap versions.

but with bootstrap 4 this comes natively.

check this link --http://getbootstrap.com.vn/examples/equal-height-columns/

like image 120
neophyte Avatar answered Sep 23 '22 13:09

neophyte


Equal height columns is the default behaviour for Bootstrap 4 grids.

.col { background: red; }  .col:nth-child(odd) { background: yellow; }
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">    <div class="container">    <div class="row">      <div class="col">        1 of 3      </div>      <div class="col">        1 of 3        <br>        Line 2        <br>        Line 3      </div>      <div class="col">        1 of 3      </div>    </div>  </div>
like image 45
Quentin Avatar answered Sep 24 '22 13:09

Quentin