JSFiddle - React, Tailwind, and code Playground
by firegroove
HTML
<ul>
<li><a>First</a></li>
<li><a>Second</a></li>
<li><a>Third</a></li>
</ul>
CSS
li {
background: red;
}
a {
position: relative;
z-index: 1;
}
a:after {
content: "";
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
transform: scaleY(0);
transform-origin: bottom center;
background: blue;
z-index: -1;
transition: transform 0.3s;
}
a:hover::after {
transform: scaleY(1);
}
a:hover{
color:white;
}