Bootstrap 4 Columns float style like Bootstrap 3 is it possible? -
i start developing bootstrap 4 , found problem : when using bootstrap 3 column system, because uses float, insert multiple columns inside row , wold fill space depending on "col-size" specified, :
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 slider fixed col-6 width , 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 content.<br>if there 1 blue box col size change 3 6 in php</div> </div> <div class="col-sm-3 panel height-2"> <div class="bg-info">blue boxes count may change depending on content.<br>if there 1 blue box col size change 3 6 in php</div> </div> <div class="col-sm-3 panel height-2"> <div class="bg-info">blue boxes count may change depending on content.<br>if there 1 blue box col size change 3 6 in php</div> </div> <div class="col-sm-3 panel height-2"> <div class="bg-info">blue boxes count may change depending on content.<br>if there 1 blue box col size change 3 6 in php</div> </div> <div class="col-sm-3 panel height-2"> <div class="bg-info">blue boxes count may change depending on content.<br>if there 1 blue box col size change 3 6 in php</div> </div> </div> but bootstrap 4 flex system each element uses full height of row , result :
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 slider fixed col-6 width , 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 content.<br>if there 1 blue box col size change 3 6 in php</div> </div> <div class="col-sm-3 card height-2"> <div class="bg-info">blue boxes count may change depending on content.<br>if there 1 blue box col size change 3 6 in php</div> </div> <div class="col-sm-3 card height-2"> <div class="bg-info">blue boxes count may change depending on content.<br>if there 1 blue box col size change 3 6 in php</div> </div> <div class="col-sm-3 card height-2"> <div class="bg-info">blue boxes count may change depending on content.<br>if there 1 blue box col size change 3 6 in php</div> </div> <div class="col-sm-3 card height-2"> <div class="bg-info">blue boxes count may change depending on content.<br>if there 1 blue box col size change 3 6 in php</div> </div> </div> i google , search on bootstrap 4 documentation dont find solution. closest cound card-columns, masonry-like example dont think work example since cant specify columns/cards width. thanks!
yes, can 3.x grid "float" behavior in bootstrap 4 using utility classes.
use d-block change row display:flex display:block. use float-left on each col..
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 slider fixed col-6 width , 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 content. <br>if there 1 blue box col size change 3 6 in 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 content. <br>if there 1 blue box col size change 3 6 in 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 content. <br>if there 1 blue box col size change 3 6 in 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 content. <br>if there 1 blue box col size change 3 6 in 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 content. <br>if there 1 blue box col size change 3 6 in php</div> </div> </div>
Comments
Post a Comment