JSFiddle - React, Tailwind, and code Playground

HTML

<ul>
    <li>
        <img src="http://www.placehold.it/300x200" />
        <div class="absolute">
            <div class="table">
                <div class="middle">
                    <p><span>Lorem Ipsum</span>
                    </p>
                </div>
            </div>
        </div>
    </li>
</ul>

CSS

li {
    position: relative;
    float: left;
    overflow: hidden;
    height: 300px;
}
img {
    width: 100%;
    vertical-align: middle;
}
.absolute, .table, .middle {
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
}
.absolute {
    position: absolute;
}
.table {
    display: table;
}
.middle {
    display: table-cell;
    vertical-align: middle;
}
p {
    background-color: rgba(255, 0, 0, .3);
}
span {
    background-color: rgba(0, 255, 0, .3);
}