title: How to stretch div height to fill parent div - CSS
body: <p>I have a page with <code>div</code>s like shown in the layout / screenshot below:</p>
  <p><a href="https://i.stack.imgur.com/jSrx1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jSrx1.png" alt="layout" /></a></p>
  <p>The code is here:</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>html,
  body {
    margin: 0;
    padding: 0;
    border: 0;
  }
  
  #B,
  #C,
  #D {
    position: absolute;
  }
  
  #A {
    top: 0;
    width: 100%;
    height: 35px;
    background-color: #99CC00;
  }
  
  #B {
    top: 35px;
    width: 200px;
    bottom: 35px;
    background-color: #999999;
    z-index: 100;
    border: solid 4px #00CC00;
  }
  
  #B2 {
    margin-top: -35px;
    bottom: 0;
    background-color: #FFFFFF;
    width: 200px;
    overflow: scroll;
  }
  
  #B1 {
    height: 35px;
    width: 35px;
    margin-left: 200px;
    background-color: #CC0066;
  }
  
  #C {
    top: 35px;
    left: 200px;
    right: 0;
    bottom: 35px;
    background-color: #CCCCCC;
  }
  
  #D {
    bottom: 0;
    width: 100%;
    height: 35px;
    background-color: #3399FF;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="container"&gt;
    &lt;div id="A"&gt;A&lt;/div&gt;
    &lt;div id="B"&gt;
      &lt;div id="B1"&gt;B1&lt;/div&gt;
      &lt;div id="B2"&gt;B2&lt;/div&gt;
    &lt;/div&gt;
    &lt;div id="C"&gt;C&lt;/div&gt;
    &lt;div id="D"&gt;D&lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>I want to adjust the height of B2 <code>div</code> to fill (or stretch to) entire B <code>div</code> (marked with a green border in the image) and don't want to cross the footer D <code>div</code>. Here is a working fiddle <a href="https://jsfiddle.net/blasteralfred/QWDxr/3683/" rel="nofollow noreferrer">link</a>(updated). How can I solve this??</p>