JSFiddle - React, Tailwind, and code Playground
by lollero
HTML
<!DOCTYPE html>
<html>
<head>
<body>
<ul>
<li>
<a class="link" href="#">Some link</a>
<span class="yellow"></span>
</li>
</ul>
</body>
</html>
CSS
ul li {
background: #8F9191;
display:block;
position:relative;
}
ul li,
.yellow {
width:100px;
height:30px;
}
.link{
position:relative;
z-index: 2;
display: block;
text-decoration:none;
color: white;
text-align:center;
line-height:27px;
}
.yellow{
background:#EDB610;
position:absolute;
z-index: 1;
top: 0px;
right: 0px;
bottom: 0px;
left: 0px;
display: none;
}
ul{
list-style:none;
}
JavaScript
$(document).ready(function(){
$('li').hover(function(){
var obj = $(this),
obj_yellow = $('.yellow', obj);
obj_yellow.stop(true,true).fadeToggle(400)
});
});