vertically align text bootstrap code example

Example 1: bootstrap center text vertically

<div class=”row”>
	<div class=”col-6 align-self-center”>
    	<div class=”card card-block”>
    		Center
        </div>
    </div>
</div>

Example 2: bootstrap column vertical align

<span class="align-baseline">baseline</span>
<span class="align-top">top</span>
<span class="align-middle">middle</span>
<span class="align-bottom">bottom</span>
<span class="align-text-top">text-top</span>
<span class="align-text-bottom">text-bottom</span>

Example 3: bootstrap table text vertical align center

/* Based on what you have provided your CSS selector is not specific enough to 
override the CSS rules defined by Bootstrap.

Try this:
*/

.table > tbody > tr > td {
     vertical-align: middle;
}

/*
In Boostrap 4, this can be achieved with the .align-middle Vertical 
Alignment utility class.
*/
<td class="align-middle">Text</td>

Example 4: vertical align bootstrap

<div class="row h-100">   <div class="col-sm-12 my-auto">     <div class="card card-block w-25">Card</div>   </div></div>

Tags:

Java Example