I've been working with this code snippet. When I set the position of .thumb-title
to absolute
and use bottom: 50%
, it shifts upwards in relation to its own height.
.project-thumb {
position: relative;
}
.thumb-title {
font: 400 1.5rem 'Lato', sans-serif;
position: absolute;
bottom: 50%;
text-align: center;
}
<li>
<a class="project-thumb" href="ktc.html">
<img class="thumb" src="thumbs/thumb-201612t-ktc.jpg">
<h3 class="thumb-title">Sample text</h3>
</a>
</li>