JSFiddle - React, Tailwind, and code Playground
HTML
<div id="banner">
FIXED HEADER
</div>
<div id="main">
normal div
<br/>
Sample Text 1
<br/>
Sample Text 2
<br/>
Sample Text 3
<br/>
Sample Text 4
<br/>
Sample Text 5
<br/>
Sample Text 6
<br/>
Sample Text 7
<br/>
Sample Text 8
</div>
CSS
#banner{
position: fixed;
top: 0;
left: 0;
z-index: 9;
background: #fff;
width: calc(100% - 1em);
padding: calc(0.5em - 1px);
border: 1px solid red;
height: 50px;
}
#main{
margin-top: calc(50px + 1em);
border: 1px solid blue;
height: 500px;
}