html - Bootstrap's grid: elements with different heights -
i've been working on application dynamicaly adds elements dom. added elements of 2 types: ones height 50px , ones 100px. displayed in of bootstrap grid system.
working example:
<div> <div class="col-xs-6" style="height: 100px;">1</div> <div class="col-xs-6" style="height: 50px;">2</div> <div class="col-xs-6" style="height: 50px;">3</div> </div>
but when try rearrange, unexpected spaces occur on layouts:
<div> <div class="col-xs-6" style="height: 50px;">2</div> <div class="col-xs-6" style="height: 100px;">1</div> <div class="col-xs-6" style="height: 50px;">3</div> </div>
between element '1' , '3' there 50px wide gap. there arrangement element '3' placed in gap? why gap occuring?
@gaurav correct.. it's happening because have specific height
set. when height:100px
col placed 2nd forces #3 wrap new row since bootstrap colums float left, not float right.
a workaround use pull-right
class on taller (100px) column...
Comments
Post a Comment