In my current scenario I have 6 equally spaced blocks 3 by 3 using Bootstrap and col-*-4. These blocks are just slightly styled thumb-nails (still using Bootstrap 3).
In these boxes I have text at the bottom, which I have positioned with:
position: absolute; bottom:0;
As well as this I have an image above which I have positioned within a DIV using:
height: 400px;
display: flex;
justify-content: center;
align-items: center;
The end result is this
My question is, instead of using a fixed height when using flex, is there a way to center the image within the entire area of the thumbnail, with the text remaining at the bottom.
Could I make the entire thumbnail display:flex
?
Added code below
HTML
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-4">
<div class="thumbnail grey mb-30">
<div class="img-center">
<img src="img/picto/originals/png/Heart/Newable_Pictogram_CoolGrey_HEART.png" class="img-responsive picto_padding" alt="...">
</div>
<div class="caption">
<h3>Responsibe finance</h3>
<p>We’re the responsible alternative for those who find High Street bank finance difficult to obtain. </p>
</div>
</div>
</div>
CSS
.img-center {
height: 350px;
display: flex;
justify-content: center;
align-items: center;
}
.grey {
background: #f0f0f0;
}
.thumbnail {
border: none;
}
.mb-30 {
margin-bottom: 30px;
}
.thumbnail {
border: none;
min-height: 450px;
position: relative;
}
.caption{
position:absolute;
bottom:0;
}