2
hello, I’m trying to align a text vertically, but the code is not working.
It is divided into 2 columns and the column with the image is larger the text is at the top
html:
<div class="col-md-12" id="id01">
<h3>Id01</h3>
<div class="row">
<div class="col-md-6 texto">
<p>
Texto alinha verticalmente
</p>
</div>
<div class="col-md-6">
<h4>texto h4</h4>
<img src="img/foto.jpeg" class="img-responsive img-circle">
</div>
</div>
</div>
css:
#id01 {
display: table;
}
#id01 .texto p {
display: table-cell;
vertical-align: middle;
}
Mix boostrap GRID with display:table will not work anyway, it will give only problem, because you are breaking the behavior of GRID
– Guilherme Nascimento
I understand, but is there a way to align vertically without losing responsiveness and not getting misaligned.
– SanekeDev
Test this https://answall.com/a/57023/3635, note that he did not put the Transform in the col, but in the child element, the elements
<p>
. You can create a sub-div and add the Transform to it.– Guilherme Nascimento
I’ll take a look, vlw..
– SanekeDev