title: height: calc(100%) not working correctly in CSS
body: <p>I have a div that I want to fill the whole height of the body less a set number in pixels. But I can't get <code>height: calc(100% - 50px)</code> to work. </p>
  
  <p>The reason I want to do this is I have elements that have dynamic heights based on some varying criteria, e.g. height of the header changes based on different elements it can contain. A content div then needs to stretch to fill the rest of the available space available.</p>
  
  <p>The div element, however, stays the height of the content - it doesn't seem as if it interprets 100% to be the height of the body element.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>body {
    background: blue;
    height: 100%;
  }
  
  header {
    background: red;
    height: 20px;
    width: 100%;
  }
  
  h1 {
    font-size: 1.2em;
    margin: 0;
    padding: 0;
    height: 30px;
    font-weight: bold;
    background: yellow;
  }
  
  #theCalcDiv {
    background: green;
    height: calc(100% - (20px + 30px));
    display: block;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;header&gt;Some nav stuff here&lt;/header&gt;
  &lt;h1&gt;This is the heading&lt;/h1&gt;
  &lt;div id="theCalcDiv"&gt;This blocks needs to have a CSS calc() height of 100% - the height of the other elements.&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I would appreciate any help or pointers in the right direction.</p>