I am struggling to achieve uniform height for all my .element
elements and need the image to be vertically aligned in the middle if it is too small to fill the space. I have tried numerous approaches but haven't been able to find a solution.
.element {
border: 10px solid #e6e6e6;
margin-bottom: 20px;
}
.element .inner {
padding: 15px;
}
.element .inner p {
margin-bottom: 5px;
text-align: center;
}
.element a {
background-color: #424753;
color: #fff;
display: block;
height: 30px;
padding-top: 3px;
text-align: center;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" rel="stylesheet" />
<div class="row">
<div class="col-3">
<div class="element">
<div class="inner">
<img class="img-fluid" src="http://www.comohacercrepes.com//ImagenesComoHacerCrepes/ImagenesCrepes/receta-crepes-masa-thermomix.jpg" />
<p>Some text</p>
</div>
<a>Link</a>
</div>
</div>
<div class="col-3">
<div class="element">
<div class="inner">
<img class="img-fluid" src="http://www.gimmesomeoven.com/wp-content/uploads/2015/08/How-To-Make-Crepes-5.jpg" />
<p>Some text</p>
</div>
<a>Link</a>
</div>
</div>
<div class="col-3">
<div class="element">
<div class="inner">
<img class="img-fluid" src="http://www.comohacercrepes.com//ImagenesComoHacerCrepes/ImagenesCrepes/receta-crepes-masa-thermomix.jpg" />
<p>Some text</p>
</div>
<a>Link</a>
</div>
</div>
<div class="col-3">
<div class="element">
<div class="inner">
<img class="img-fluid" src="http://www.comohacercrepes.com//ImagenesComoHacerCrepes/ImagenesCrepes/receta-crepes-masa-thermomix.jpg" />
<p>Some text</p>
</div>
<a>Link</a>
</div>
</div>
</div>