JSFiddle - React, Tailwind, and code Playground
HTML
<header>header stuff here</header>
<div class="content">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
<footer>footer stuff here</footer>
CSS
/* "dirty", quick reset */
* {
padding: 0;
margin: 0;
}
/* set the width to 100% and the height to 100vh (or 100% of the viewport height) */
html, body {
width: 100%;
height: 100vh;
}
/* for the padding and margins for the main three containers: header, content, footer */
body > * {
-moz-box-sizing: border-box;
box-sizing: border-box;
}
/* header parameters */
header {
height: 40px;
background: red;
}
/* footer parameters */
footer {
height: 40px;
background: red;
}
/* content parameters: note how the height is calculated it is the viewport height minus the height of the footer and header combined */
/* overflow line is important to ensure scrolling of only the content window if needed */
.content {
height: calc(100vh - 80px);
background: blue;
overflow: auto;
}