JSFiddle - React, Tailwind, and code Playground
HTML
<a class="hover-me">
<span class="caption">VIEW</span>
<img src="http://lorempixel.com/261/261/"/>
</a>
CSS
.hover-me {
position: relative;
width: 250px;
display: inline-block;
}
.hover-me img{
width:100%;
height:auto;
display: block;
}
.hover-me:after {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 1;
background: rgba(255,0,0,.5);
transition: all .5s ease;
opacity: 0;
}
.hover-me .caption {
display: block;
height: 50%;
position: absolute;
top: 50%;
left: 0;
right: 0;
margin-top: -10px;
text-align: center;
transition: all .5s ease;
opacity: 0;
z-index: 2;
color: #fff;
line-height: 20px;
}
.hover-me:hover:after , .hover-me:hover .caption {
opacity: 1;
}