I am trying to use the following CSS rules to vertically center aligned content in bootstrap 3 -
.center {
display:flex;
align-items:center !important;
background-color:red;
text-align:center;
}
@media ( min-width:768px ) {
.center {
display:flex;
align-items:center !important;
background-color:red;
text-align:center;
}
}
@media ( min-width: 992px ) {
.center {
display:flex;
align-items:center !important;
background-color:red;
text-align:center;
}
}
@media ( min-width: 1200px ) {
.center {
display:flex;
align-items:center !important;
background-color:red;
text-align:center;
}
}
And, here is my html
<div class="row center"> <!--if .center is here valign works-->
<div class="col-sm-4"> <!--if .center is here valign doesn't work-->
test
</div>
<div class="col-sm-8 ">
test </br>
test </br>
test </br>
</div>
You can find it in codepen.io.
Any help?