JSFiddle - React, Tailwind, and code Playground
HTML
<div id="body">
<div id="header">
Header...
</div>
<div id="content">
<div id="main">
<p>Content</p><p>Content</p><p>Content</p><p>Content</p><p>Content</p><p>Content</p><p>Content</p><p>Content</p><p>Content</p><p>Content</p><p>Content</p><p>Content</p><p>Content</p><p>Content</p><p>Content</p><p>Content</p><p>Content</p><p>Content</p><p>Content</p><p>Content</p><p>Content</p><p>Content</p><p>Content</p><p>Content</p><p>Content</p><p>Content</p><p>Content</p>
</div>
<div id="parent">
<div id="background">
</div>
<div id="card">
Lorem...
</div>
</div>
</div>
</div>
CSS
#body {
top: 0;
bottom: 0;
right: 0;
left: 0;
position: absolute;
overflow: hidden;
}
#header {
position: fixed;
height: 50px;
background-color: yellow;
opacity: 0.5;
width: 100%;
}
#content {
position: absolute;
top: 50px;
bottom: 0;
right: 0;
left: 0;
overflow: auto;
}
#parent {
position: fixed;
top: 0;
bottom: 0;
right: 0;
left: 0;
overflow: auto;
}
#background {
opacity: 0.5;
position: fixed;
top: 0;
bottom: 0;
right: 0;
left: 0;
background-color: blue;
}
#card {
position: relative;
margin: 50px 50px 0;
background-color: white;
height: 2000px;
border: 5px solid red;
}