Clear Rows When Doing Multi-responsive Columns - Bootstrap -
that title might not accurate here situation:
can see in html, grid system goes 4 images on xl screens to 3 on lg screens 2 on less.
i trying display - proper amount of images @ each screen size, is. however, funky going on , can't quite figure out using bootstraps classes.
it seems me have add rows dynamically @ each break-point.
any suggestions?
-- update -- realized col-xl-* doesn't exist. however, not change situation @ all. please disregard xl declaration.
-- update 2 -- updated images.
-- update 3 -- i'll try clarify goal. specific image attached in post, 3 boxes appear per row - not helter skelter.
when collapses down 2 boxes per row (xs device), want make sure every row has 2 boxes.
i solved issue adding clearfix
elements should be. wanted 3 columns on md
, 2 columns on sm
, how did it:
<div class="row"> <div class="col-sm-6 col-md-4"></div> <div class="col-sm-6 col-md-4"></div> <div class="clearfix visible-sm"></div> <div class="col-sm-6 col-md-4"></div> <div class="clearfix visible-md"></div> <div class="col-sm-6 col-md-4"></div> <div class="clearfix visible-sm"></div> <div class="col-sm-6 col-md-4"></div> <div class="col-sm-6 col-md-4"></div> <div class="clearfix visible-md"></div> <div class="clearfix visible-sm"></div> <div class="col-sm-6 col-md-4"></div> </div>
so used clearfix visible-sm
after every second div , clearfix visible-md
after every third div. don't find solution ideal, works rather well.
edit: of bootstrap v3.2.0 .visible-*
classes deprecated.
http://getbootstrap.com/css/#responsive-utilities:
the classes .visible-xs, .visible-sm, .visible-md, , .visible-lg exist, deprecated of v3.2.0. approximately equivalent .visible-*-block, except additional special cases toggling -related elements.
edit 2: solution works long not want edit css, if have option so, recommend use jonas's answer simpler in opinion.
Comments
Post a Comment