JSFiddle - React, Tailwind, and code Playground
HTML
<div class="fixed">
<div class="yellow">
<div class="green">
<div class="white">
<div class="black"></div>
</div>
</div>
</div>
</div>
CSS
html, body { height:100% }
body { padding:0 ;
margin:0 ;
}
.fixed { height:100% ;
min-height:100% !important ;
background:#666666 ;
position:relative ;
z-index:1 ;
}
.yellow, .green, .white, .black {
display:block ;
margin:auto !important ;
position:absolute ;
top:0 ;
bottom: 0 ;
right: 0 ;
left: 0 ;
}
.yellow { width:220px ;
height:220px ;
background:yellow ;
z-index:100 ;
}
.green { width:170px ;
height:170px ;
z-index:200 ;
background:green ;
}
.white { width:100px ;
height:100px ;
z-index:200 ;
background:white ;
}
.black { width:50px ;
height:50px ;
z-index:300 ;
background:black ;
}