JSFiddle - React, Tailwind, and code Playground

by Tyler

HTML

<div class="image">
    <img src="http://www.newyorker.com/online/blogs/photobooth/NASAEarth-01.jpg" alt="" />
</div>

CSS

.image {
    position:relative;
    width:400px;
    height:400px;
}
.image img {
    width:100%;
    vertical-align:top;
}
.image:after {
    content:'Hello';
    color: #000000;
    vertical-align: middle;
    text-align: center;
    position: absolute;
    width:100%;
    height:100%;
    top:0;
    left:0;
    background: rgba(255, 255, 255, 0.7);
    opacity:0;
    transition: all 0.5s;
    -webkit-transition: all 0.5s;
    line-height: 400px;
}
.image:hover:after {
    opacity: 1;
}