JSFiddle - React, Tailwind, and code Playground
HTML
<div class="relpos">
<div class="static">
<div class="fixedpos">
</div>
</div>
</div>
<!-- This is just for readability -- it doesn't influence behavior: -->
<div class="marker">
^^ Teal div should extend to hereee
</div>
CSS
body {
margin: 0
}
.relpos {
position: relative;
overflow: auto;
height: 100px;
width: 100px;
border: 2px solid orange;
/* DELETE TO WORK AROUND BUG: */
z-index: 0;
}
.static {
height: 96px;
width: 97px;
/* UNCOMMENT TO "FIX" THE BUG */
/* width: 96px; */
border: 2px solid yellow;
}
.fixedpos {
position: fixed;
width: 200px;
height: 200px;
background: teal;
border: 2px solid black;
}
.marker {
position: absolute;
top: 205px;
}