JSFiddle - React, Tailwind, and code Playground
HTML
<div align="right" id="mprint">
<a href="javascript:window.print()">Print Preview</a>
</div>
<header class="headerDiv" style="width:100%; margin:0 auto;">
</header>
<div class="contentDiv">
<h1>1 test Test TEst TESt TEST</h1>
<h1>2 test Test TEst TESt TEST</h1>
<h1>3 test Test TEst TESt TEST</h1>
<h1>4 test Test TEst TESt TEST</h1>
<h1>5 test Test TEst TESt TEST</h1>
<h1>6 test Test TEst TESt TEST</h1>
<h1>7 test Test TEst TESt TEST</h1>
<h1>8 test Test TEst TESt TEST</h1>
<h1>9 test Test TEst TESt TEST</h1>
<h1>12 test Test TEst TESt TEST</h1>
<h1>13 test Test TEst TESt TEST</h1>
<h1>14 test Test TEst TESt TEST</h1>
<h1>15 test Test TEst TESt TEST</h1>
<h1>16 test Test TEst TESt TEST</h1>
<h1>17 test Test TEst TESt TEST</h1>
<h1>18 test Test TEst TESt TEST</h1>
<h1>19 test Test TEst TESt TEST</h1>
<h1>20 test Test TEst TESt TEST</h1>
<h1>21 test Test TEst TESt TEST</h1>
<h1>22 test Test TEst TESt TEST</h1>
<h1>23 test Test TEst TESt TEST</h1>
<h1>24 test Test TEst TESt TEST</h1>
<h1>25 test Test TEst TESt TEST</h1>
<h1>26 test Test TEst TESt TEST</h1>
</div>
<footer class="reportFooter"></footer>
CSS
.headerDiv{
width:100%;
background-color:cadetblue;
height:100px;
}
.contentDiv{
}
.reportFooter {
bottom: 0px;
width: 100%;
background-color:gray;
display:block;
height:100px;
}
@media print{
.headerDiv{
position:fixed;
top:0px;
width:100%;
background-color:cadetblue;
height:100px;
}
.contentDiv{
z-index:100;
}
.reportFooter {
position:fixed;
bottom: 0px;
width: 100%;
background-color:gray;
display:block;
height:100px;
}
}