UPDATE: I just want to mention that the height of these spans is unknown due to responsiveness!
I am attempting to vertically align two <div class="span6">
's within a <div class="row">
using Bootstrap, but I am facing difficulties with my usual methods like display: inline-block;
or display: table-cell;
(you can find the JSFiddle link here: http://jsfiddle.net/mA6Za/).
Here's what I have tried so far, but it doesn't work as expected in Bootstrap:
<div class="container">
<div class="row" style="display: table">
<div class="span6" style="height: 300px; background: red; display: table-cell !important; vertical-align: middle;">
Block 1 - Please center me vertically!
</div>
<div class="span6" style="height: 170px; background: blue; display: table-cell !important; vertical-align: middle;">
Block 2- Center me too
</div>
</div>
</diV>
Is there a way to vertically align these two .span6
's without specifying the height of Block1
and Block2
? We would like to make use of Bootstrap for responsive design, but also ensure that the content aligns vertically on tablets and larger screens.