0

I have a question regarding centering row vertically!

I have here a simple html, with use of bootstrap 3:

 <div class="container">
 <div class="row">
 <div class="col-sm-12 text-center" style="padding:5 20 5 20;">
Some text text text text text .....
 </div>
 </div>
 <div class="row">
 <div class="col-sm-12">
 <div class="thumbnail">

      <img data-src="holder.js/460x308">

  </div>
 </div>
 </div>
 </div>

I would like to center this container or row ... doesn't matter.

So imagine i have a window which is 500px x 500px

I would like to pisition it in the middle of it, not on top (what is now the case) or bottom, but in center

PS: http://jsfiddle.net/e89TE/

Alnedru
  • 2,573
  • 9
  • 50
  • 88
  • possible duplicate of [How to center a div in a div - horizontally?](http://stackoverflow.com/questions/114543/how-to-center-a-div-in-a-div-horizontally) – Beterraba Jan 28 '14 at 19:41

2 Answers2

1

try this css:

.container{
   display:table;
}

.row{
   display: table-cell;
   vertical-align: middle;
}

should work. ps. post a fiddle next time

Jay Lane
  • 1,379
  • 15
  • 28
0

First thing you will need to do if you want the type on TOP of the image is make the image a background image:

<div class="col-sm-12 text-center">
    <div class="foo">
    Some text text text text text …..
    </div>
</div>

The css

.foo {
background-image:url("holder.js/460x308");
}
moodyjive
  • 1,807
  • 16
  • 17