I am trying to create a layout with a header on top, underneath it a sidebar and the main content.
I would like to have the sidebar and the content view take over the vertical space left by the header. The problem is that the header can dynamically re-size so I cannot perform a calc()
. My solution was to use the flexbox scheme.
I divided the viewport horizontally into two parts. One is the header and one is a wrapper for the sidebar and main content.
The sidebar is floated left and given a percentage of the width and the content is floated right and given the rest.
The problem is that I am trying to make the sidebar always be 100% height of the wrapper.
I tried height: 100%
and min-height: 100%
but these do not work.
I do not wish to absolutely position it since if the wrapper were to overflow with the main content, the sidebar would not expand accordingly.
Here is my pen: http://codepen.io/markt5000/pen/JXNXpW
As you can see the orange is the header and the red space is the wrapper with the sidebar and the content.
here is the layout
<div class="header">
</div>
<div class="row">
<div id="sidebar">
</div>
<div id="main-content">
</div>
</div>