I want to vertically align one or multiple images with a text (whose height is unknown). The images should be vertically centered:
The current HTML code looks like this:
<div class="row">
<div class="col-md-3">
<img src="images/sampleimage.png" class="img-rounded img-responsive"/>
</div>
<div class="col-md-9">
Text goes here
</div>
</div>
How can I achieve this without knowing the height of the text column?
Edit I can now center align the images: CSS:
row-xs-flex-center {
display:flex;
align-items:center;
}
@media ( min-width:800px ) {
.row-sm-flex-center {
display:flex;
align-items:center;
}
}
@media ( min-width: 992px ) {
.row-md-flex-center {
display:flex;
align-items:center;
}
}
@media ( min-width: 1200px ) {
.row-lg-flex-center {
display:flex;
align-items:center;
}
}
with the div changed as follows:
<div class="row row-sm-flex-center">
But the images stick on top of each other. Is there a way to evenly vertically distribute the images?