Is there any work around for vertical alignment of elements or texts in bootstrap spans relative to other spans
For eg. if I have a row and spans like this
<div class="row-fluid">
<div class="span3" style="background-color:lightblue">Description</div>
<div class="span9" style="background-color:pink">
Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum ....
</div>
</div>
It looks like this
So is there a way to show "Description" vertically center of the next span's height?
In Bootstrap there is no provision for such issue. It is implantation dependent. However you can write a css rule saying if next div exceeds the height of a previous div align the previous div at center height of next div & apply this class to the divs wherever you want this kind of behaviour.
Check out this script-free solution.
The code in action: jsFiddle
Just remove the inline styling and place it in your css file.
try
display: table;
for parent anddisplay: table-cell;
for childJSFiddle
If you are trying to vertically center an element for certain screen sizes you could always use media queries such as:
I worked a lot on this , and a simple solution by using
jquery
is shown here !It works and i tested it also . If you like my answer please vote for me