Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bootstrap 3.0 responsive 5 images in one row

I am having a problem with bootstrap 3.0 making 5 images in one Row and make those responsive ? The grid system is based of 12 , so how to make 5 images and they look centered without any spaces ?

Also is there away I can make when viewed on tablets or smartphones <480 px to be 2 images per raw? right now it shows 5 images under each other??

here is my code:

<div class="row">
 <div class="col-md-2">
 <img class="img-responsive" src="/images/img1.jpg" />
 </div>
   <div class="col-md-2">
   <img class="img-responsive" src="/images/img2.jpg" />
 </div>

 <div class="col-md-2">
 <img class="img-responsive" src="/images/img3.jpg" />
 </div>
   <div class="col-md-2">
   <img class="img-responsive" src="/images/img4.jpg" />
 </div>
  <div class="col-md-2">
   <img class="img-responsive" src="/images/img4.jpg" />
 </div>
</div>

As you can see I am using col-md-2 Along with img-responsive? but its not working really because its not centered

like image 785
user3150060 Avatar asked May 30 '14 22:05

user3150060


Video Answer


1 Answers

You could have an empty column on either side:

<div class="row">
 <div class="col-md-2 col-md-offset-1">
   <img class="img-responsive" src="/images/img1.jpg" />
 </div>
 <div class="col-md-2">
   <img class="img-responsive" src="/images/img2.jpg" />
 </div>

 <div class="col-md-2">
   <img class="img-responsive" src="/images/img3.jpg" />
 </div>
 <div class="col-md-2">
   <img class="img-responsive" src="/images/img4.jpg" />
 </div>
 <div class="col-md-2">
   <img class="img-responsive" src="/images/img4.jpg" />
 </div>
</div>
like image 177
Steve Sanders Avatar answered Oct 06 '22 00:10

Steve Sanders