JSFiddle - React, Tailwind, and code Playground
by rohanbhangui
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
/* how to do web app setup without calc() */
/* "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 {
position: absolute;
bottom: 0;
width: 100%;
height: 40px;
background: red;
}
/* overflow line is important to ensure scrolling of only the content window if needed */
.content {
position: absolute;
background: blue;
width: 100%;
bottom: 40px;
top: 40px;
overflow: auto;
}