Ricky Kurniawan Ricky Kurniawan - 6 months ago 10
HTML Question

how to made image in class="row" in bootstrap be in the middle

i have a problem with my website: screenshot.

How do I make what I circled be in the middle, parallel with the navbar?
This is my code :

<div class="container">
<div class="row">
<div class="col-md-4 col-sm-6 col-xs-12 text-center">
<div class="thumbnail">
<img src="" alt="">
<div class="caption">
<h4>label</h4>
<p>adadasdasd</p>
<a href="#" class="btn btn-primary" role="button">add to chart</a>
</div>
</div>
</div>
</div>
</div>

Answer

First, maybe you can read this: http://www.w3schools.com/bootstrap/bootstrap_grid_basic.asp

With the grid basic, you know col-12 is the whole width. If you want to make it in the middle try this: (This might not be the best code here, but should work).

<div class="col-md-4"></div>
  <div class="col-md-4">
     <YOUR BOX GO HERE>
  </div>
<div class="col-md-4"></div>

Let me know if it was helpful.

Thanks

Comments