JSFiddle - React, Tailwind, and code Playground
HTML
<div class="parent">
<div class="front"></div>
<div class="back"></div>
</div>
CSS
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
.parent {
position: relative;
width: 100%;
height: 100%;
}
.parent .front, .parent .back {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.parent .front {
background: red;
z-index: 1;
}
.parent .back {
background: blue;
z-index: 0;
}
.parent:hover .back {
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
-ms-transition: all 0.5s ease;
-khtml-transition: all 0.5s ease;
transition: all 0.5s ease;
-webkit-transition-delay: 4s;
-moz-transition-delay: 4s;
-ms-transition-delay: 4s;
-o-transition-delay: 4s;
transition-delay: 1s;
height:30%;
z-index: 5;
}