JSFiddle - React, Tailwind, and code Playground

by Tymoteusz Czech

HTML

<div id="trigger"></div>

<div id="bg">
</div>

CSS

body {
    height: 100%;
}

#bg {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    widht: 100%;
    height: 100%;
    z-index: 1;
    background: #EEE;
}

#trigger {
    position: absolute;
    width: 200px;
    height: 136px;
    top: 50%;
    left: 50%;
    margin: -68px 0 0 -100px;
    background: #333;
    z-index: 2;
}

#trigger:hover ~ #bg {
    background: #EE0;
}

JavaScript

// Background change on div hover