title: CSS position absolute content area not growing
body: <p>I am trying to create an HTML of a design. I am stuck with one issue.
  The CSS n HTML structure is as an image that i have attached here.
  I want the footer to be in the bottom of the page where the content area when grows should push the footer down. But if there is no content the content area should be till the footer.
  actually the content area is coming over the header and footer area.
  i don't know if i structured it right.</p>
  
  <p><img src="https://i.stack.imgur.com/JRDz6.jpg" alt="enter image description here"></p>
  
  <pre><code>    &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
      &lt;head&gt;
  &lt;style&gt;
  html, body { height:100%;}
  body {
      background: #EBEBEB;
      margin: 0px;
      padding: 0px;
  }
  #wrapper {
      width:100%;
      height:100%;
      margin: 0 auto;
      position:relative;
  }
  #header {
      width:100%;
      height:147px;
      background:#999;
      border-bottom:solid 5px #ddd;
      position:absolute;
  }
  #footer {
      bottom:0;
      width:100%;
      height:170px;
      position:absolute;
      background-color:#ccc;
      border-top:solid 5px #ddd;
  }
  #contentArea {
      width:300px;
      max-height:100%;
      position:absolute;
      z-index:999;
      left:0;
      right:0;
      top:0;
      bottom:0;
      margin-left:auto;
      margin-right:auto;
      margin-top:120px;
      margin-bottom:100px;
      background:#FFF;
      border:solid 1px red;
  }
  &lt;/style
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;div id="wrapper"&gt;
      &lt;div id="header"&gt;Header&lt;/div&gt;
      &lt;div id="footer"&gt;footer&lt;/div&gt;
      &lt;div id="contentArea"&gt;
          Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.  Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. 
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>check the code <a href="http://jsfiddle.net/angel3m/CDeLe/12/" rel="nofollow noreferrer">here</a>.</p>