I have the following code
http://codepen.io/anon/pen/EZeVXG
HTML
<a href="#" class="col-inner">
<img src="http://placehold.it/450x450" />
<div class="content">
<h3>Hello World</h3>
<p>Lorem Ipsum Dolor Sit Amet</p>
</div>
</a>
CSS
img{
max-width: 100%;
height: auto;
}
.col-inner{
position: relative;
display: inline-block;
}
.content{
position: absolute;
width: 90%;
height: 90%;
top: 5%;
left: 5%;
background-color: rgba(0,0,0,.7);
color: #FFF;
text-align: center;
}
I've tried a bunch of techniques found on Stack Overflow but everything seems to work only if you know the width and height. Both of those properties will change as you flex the browser. Is there any way to keep the text centered vertically the whole way?