I'm attempting to build the "Holy Grail" layout using Flexbox.
- Fixed Header
- Fixed, Collapsible, Scrollable Left Nav
- Flexible Content Area
- Fixed, Collapsible, Scrollable Right Nav
See below:
I have everything working, except for the height of the "app" area underneath the header. Right now it's 100vh (100% of the viewport height), but this includes the 64px header.
I attempted calc(100vh - 64px), but that doesn't jive well with flex.
Here's my basic HTML structure:
<main>
<header></header>
<app>
<nav>Left Nav</nav>
<article>Content</article>
<aside>Right Nav</aside>
</app>
</main>
And the supporting CSS:
main {
display: flex;
flex-direction: column;
}
header {
z-index: 0;
flex: 0 0 64px;
display: flex;
}
app {
flex: 1 1 100vh;
display: flex;
}
nav {
flex: 0 0 256px;
order: 0;
}
article {
flex: 1 1 100px;
order: 1;
}
aside {
flex: 0 0 256px;
order: 2;
}