JSFiddle - React, Tailwind, and code Playground
HTML
<div class="container">
<div class="overlay"><a href="#">Photography</a></div>
<div class="img"></div>
</div>
CSS
.container{
width: 400px;
height: 200px;
position: relative;
}
.container:hover .overlay{
opacity: 1;
}
.container:hover .img{
opacity: 0.5;
}
.img{
background: url("http://www.placecage.com/400/200") no-repeat;
height: 100%;
width: 100%;
transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-webkit-transition: all 0.5s ease-in-out;
}
.overlay{
position: absolute;
top: 0;
left: 0;
opacity: 0;
width: 100%;
height: 100%;
text-align: center;
transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-webkit-transition: all 0.5s ease-in-out;
}
a{
display: inline-block;
font-family: "Arial";
font-size: 24px;
color: #000;
text-decoration: none;
text-transform: uppercase;
text-align: center;
line-height: 200px;
}