Bootstrap 4 Columns float style like Bootstrap 3, is this possible?

I'm starting to develop using bootstrap 4, and now I have found this problem: when using bootstrap-3 column system, since it uses float, we could insert several columns inside the row, and wold fill the gap depending on the specified " col-size ", for example:

http://codepen.io/seltix/pen/QpXvRJ

 -------   -------   -------
| COL 1 | | COL 2 | | COL 3 |
|       |  -------   -------
|       | | COL 4 | | COL 5 |
 -------   -------   -------

<div class="container-fluid">
  <div class="row">
    <div class="col-sm-6 panel height-1">
      <div class="bg-danger">this box is a slider with fixed col-6 width and fixes 2 blue boxes height</div>
    </div>
    <div class="col-sm-3 panel height-2">
      <div class="bg-info">blue boxes count may change depending on the content.<br>if there are only 1 blue box the col size will change from 3 to 6 in the PHP</div>
    </div>
    <div class="col-sm-3 panel height-2">
      <div class="bg-info">blue boxes count may change depending on the content.<br>if there are only 1 blue box the col size will change from 3 to 6 in the PHP</div>
    </div>
    <div class="col-sm-3 panel height-2">
      <div class="bg-info">blue boxes count may change depending on the content.<br>if there are only 1 blue box the col size will change from 3 to 6 in the PHP</div>
    </div>
    <div class="col-sm-3 panel height-2">
      <div class="bg-info">blue boxes count may change depending on the content.<br>if there are only 1 blue box the col size will change from 3 to 6 in the PHP</div>
    </div>
    <div class="col-sm-3 panel height-2">
      <div class="bg-info">blue boxes count may change depending on the content.<br>if there are only 1 blue box the col size will change from 3 to 6 in the PHP</div>
    </div>
</div>

but with flex bootstrap 4 system, each element uses the entire line height, and the result is this:

http://codepen.io/seltix/pen/PprmVE

 -------   -------   -------
| COL 1 | | COL 2 | | COL 3 |
|       |  -------   -------
|       |
 -------   -------
| COL 4 | | COL 5 |
 -------   -------

<div class="container-fluid">
  <div class="row">
    <div class="col-sm-6 card height-1">
      <div class="bg-danger">this box is a slider with fixed col-6 width and fixes 2 blue boxes height</div>
    </div>
    <div class="col-sm-3 card height-2">
      <div class="bg-info">blue boxes count may change depending on the content.<br>if there are only 1 blue box the col size will change from 3 to 6 in the PHP</div>
    </div>
    <div class="col-sm-3 card height-2">
      <div class="bg-info">blue boxes count may change depending on the content.<br>if there are only 1 blue box the col size will change from 3 to 6 in the PHP</div>
    </div>
    <div class="col-sm-3 card height-2">
      <div class="bg-info">blue boxes count may change depending on the content.<br>if there are only 1 blue box the col size will change from 3 to 6 in the PHP</div>
    </div>
    <div class="col-sm-3 card height-2">
      <div class="bg-info">blue boxes count may change depending on the content.<br>if there are only 1 blue box the col size will change from 3 to 6 in the PHP</div>
    </div>
    <div class="col-sm-3 card height-2">
      <div class="bg-info">blue boxes count may change depending on the content.<br>if there are only 1 blue box the col size will change from 3 to 6 in the PHP</div>
    </div>
</div>

i already google it and search in bootstrap 4 documentation for this, but i cannot find any solution. the next i-th quarter was a card column, a masonry-like example, but I don’t think it works for this example, since I cannot specify the width of the columns / cards. thank!

0
1

, "float" 3.x Bootstrap 4 .

d-block, : flex to display: block. float-left .

http://www.codeply.com/go/BmN6ZYQdGm

 <div class="row d-block">
        <div class="col-md-6 float-left card height-1">
            <div class="bg-danger">1
                <br>this box is a slider with fixed col-6 width and fixes 2 blue boxes height</div>
        </div>
        <div class="col-md-3 float-left card height-2">
            <div class="bg-info">2
                <br>blue boxes count may change depending on the content.
                <br>if there are only 1 blue box the col size will change from 3 to 6 in the PHP</div>
        </div>
        <div class="col-md-3 float-left card height-2">
            <div class="bg-info">3
                <br>blue boxes count may change depending on the content.
                <br>if there are only 1 blue box the col size will change from 3 to 6 in the PHP</div>
        </div>
        <div class="col-md-3 float-left card height-2">
            <div class="bg-info">4
                <br>blue boxes count may change depending on the content.
                <br>if there are only 1 blue box the col size will change from 3 to 6 in the PHP</div>
        </div>
        <div class="col-md-3 float-left card height-2">
            <div class="bg-info">5
                <br>blue boxes count may change depending on the content.
                <br>if there are only 1 blue box the col size will change from 3 to 6 in the PHP</div>
        </div>
        <div class="col-md-3 float-left card height-2">
            <div class="bg-info">6
                <br>blue boxes count may change depending on the content.
                <br>if there are only 1 blue box the col size will change from 3 to 6 in the PHP</div>
        </div>
    </div>

http://www.codeply.com/go/BmN6ZYQdGm


: Bootstrap 4 - ,

0

Source: https://habr.com/ru/post/1679927/


All Articles