Bootstrap portofolio - empty mesh space

I'm having problems with the grid in bootstrap grid. I have free spaces in a row. On the desktop this is displayed on the desktop, and on the mobile phone - enter image description here .

The code I'm using is

<div class="row"> <div class="col-xs-6 col-md-3 col-sm-4 portfolio-item"> <a href="#"> <img class="img-responsive" src="image/book image/book1.png" alt=""> </a> </div> <div class="col-xs-6 col-md-3 col-sm-4 portfolio-item"> <a href="#"> <img class="img-responsive" src="image/book image/book2.png" alt=""> </a> </div> <div class="col-xs-6 col-md-3 col-sm-4 portfolio-item"> <a href="#"> <img class="img-responsive" src="image/book image/book3.png" alt=""> </a> </div> <div class="col-xs-6 col-md-3 col-sm-4 portfolio-item"> <a href="#"> <img class="img-responsive" src="image/book image/book4.png" alt=""> </a> </div> <div class="col-xs-6 col-md-3 col-sm-4 portfolio-item"> <a href="#"> <img class="img-responsive" src="image/book image/book4.png" alt=""> </a> </div> </div> 

I really don't know how I can fix this, so I hope someone can give me some advice.

+6
source share
4 answers

You must set the min-height for the columns, since the columns have different heights.

 .portfolio-item { min-height: 200px; } 

Change 200px to the minimum that will fit the columns in the appropriate places.

+3
source

This is due to the different heights on your divs. You have several possible fixes for this:

+1
source

make sure all book images are the same size ... or just set the min-height to the portfolio-element class.

0
source

Just add a clearfix class after each line

0
source

All Articles