JSFiddle - React, Tailwind, and code Playground
HTML
<div class="fixed first">
<p>This is a fixed element</p>
<p class="abs">
I should be displayed above both fixed position elements
</p>
</div>
<div class="fixed second">
<p>This is a fixed element</p>
</div>
CSS
.fixed {
font-size: 16px;
background: #eee;
border-bottom: 1px solid #ccc;
position: fixed;
height: 3em;
width: 100%;
z-index: 1;
}
.abs {
position: absolute;
background: #acc;
height: 6em;
top: 0;
left: 25%;
width: 50%;
z-index: 2;
}
.second {
top: 3.0625em;
}