JSFiddle - React, Tailwind, and code Playground

HTML

<div class="fixed"></div>
<div class="wrapper">
  <div class="child"></div>
</div>

CSS

.fixed {
  background: blue;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
}

.wrapper, .child {
  position: absolute;  
  height: 20px;
  width: 20px;
  padding: 20px;
}

.wrapper {
  z-index: 1;
  background: red;
}

.child {
  position: absolute;
  z-index: 3;
  background: yellow;
}