Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap columns skip two places

I have a PHP page with a few items on a page. I want three columns on large monitors but this is what it does. One column just skips two columns on the first page. It does not do that when there's four columns, but I want three.

There are no other style on columns so why does it do this?

This is what "insperct element" reveals.

like image 882
Mish.k.a Avatar asked Mar 31 '16 13:03

Mish.k.a


2 Answers

Tanbi's suggestion is good as per bootstrap guidelines but if you don't want to add .row div between the item div you can use below mentioned css

.col-md-4:nth-child(3n+3) + .col-md-4{clear:both;}

I'm not sure but I think it's work.

like image 62
Dharmendra Bisht Avatar answered Sep 22 '22 08:09

Dharmendra Bisht


its about elements height. you can use the row classed divs as follow.

<div class="row">
  <div class="col-md-4 col-sm-6 col-xs-12">...</div>
  <div class="col-md-4 col-sm-6 col-xs-12">...</div>
  <div class="col-md-4 col-sm-6 col-xs-12">...</div>
</div>
<div class="row">
  <div class="col-md-4 col-sm-6 col-xs-12">...</div>
  <div class="col-md-4 col-sm-6 col-xs-12">...</div>
  <div class="col-md-4 col-sm-6 col-xs-12">...</div>
</div>
like image 31
Tanbi Avatar answered Sep 18 '22 08:09

Tanbi