JSFiddle - React, Tailwind, and code Playground
HTML
<a href="#" class="box"><img src="anyimage.jpg" alt="test" width="150" height="150" /><div class="boxover">hello</div></a>
<a href="#" class="box"><img src="anyimage.jpg" alt="test" width="150" height="150" /><div class="boxover">there</div></a>
<a href="#" class="box"><img src="anyimage.jpg" alt="test" width="150" height="150" /><div class="boxover">rob</div></a>
CSS
body{background:gray;}
div{position:relative;}
.box{
position:relative;
width:150px;
height:150px;
float:left;
display:block;
background:black;
margin-right:20px;
}
.boxover{
position:absolute;
top:10px;
left:0px;
width:100%;
height:20px;
z-index:100;
background:white;
display:none;
}
JavaScript
$(function() {
$('.box').hover(over, out);
});
function over(event) {
$('.boxover', this).fadeIn(2000);
$('.boxover', this).css("display", "normal");
}
function out(event) {
$('.boxover', this).fadeOut(2000);
}