JSFiddle - React, Tailwind, and code Playground

by sandeep

HTML

<div id="wrapper">

     I want this to change color when button hovered

     <div class="button">Close</div>

</div>

CSS

#wrapper{position:relative;}
#wrapper:hover .button{
 color:red;
}
.button:hover:after{
    content:"";
    background:yellow;
    position:absolute;
    top:0;
    left:0;
    right:0;
    bottom:0;
    z-index:-1
}