JSFiddle - React, Tailwind, and code Playground
HTML
<div id="wrapper">
<div id="header">
<div id="header-content" class="maxwidth">
Header (this is fixed)
</div>
</div>
<div class="divide">
<div id="sub">
<div id="sub-content" class="maxwidth">
Sub-header
</div>
</div>
<div id="content" class="maxwidth">
<div id="main">
Main<br />
Main<br />
Main<br />
Main<br />
Main<br />
Main<br />
Main<br />
</div>
</div>
<div class="push"></div>
<div id="footer">
<div id="footer-content" class="">
Footer
</div>
</div>
</div>
</div>
<div class="rest">
<div id="sidebar">
Sidebar<br/>Sidebar<br/>Sidebar<br/>
</div></div>
CSS
html, body {
margin: 0px;
padding: 0px;
min-height: 100%;
height: 100%;
}
.maxwidth { max-width: 1000px; margin: 0 auto; }
#wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -50px; /* the bottom margin is the negative value of the footer's height */
position: relative;
}
#footer {
height: 50px;
border: 1px solid magenta;
position:fixed;
bottom:0px;
width:85%;
}
#footer-content {
height: 32px; /* height + top/bottom paddding + top/bottom border must add up to footer height */
padding: 8px;
}
.push {
height: 50px;
clear: both;
}
#header {
width: 100%;
position: fixed;
height: 50px;
border: 1px solid magenta;
}
#header-content {
height: 32px; /* height + top/bottom paddding + top/bottom border must add up to footer height */
padding: 8px;
}
#sub {
border: 1px solid magenta;
padding-top: 50px;
width: 100%;
height: 50px;
}
#sub-content {
height: 32px; /* height + top/bottom paddding + top/bottom border must add up to footer height */
padding: 8px;
}
#content {
position: relative; /* maybe */
height: 100%;
}
#sidebar {
border: 1px solid skyblue;
width: 15%;
position: absolute;
right: 0;
top: 50px;
min-height: 100%;
bottom: 0px;
}
#main {
}
.divide{
width:85%;
}
.rest{
float:right;
}