title: Simple div with header,footer and body
body: <p>I need a simple <code>div</code> with <code>header,footer and body content.</code></p>
  
  <p>The <code>header</code> and <code>footer</code> needs to be <code>fixed</code> and the <code>height</code> of div should be <code>250px</code> or max <code>500px</code> and its <code>width</code> is <code>500px</code>
  And my <code>body content</code> should be <code>fluid</code> so that it should extend the content.</p>
  
  <p><code>Header</code> and <code>footer</code> needs to be <code>40px.</code></p>
  
  <p>And I need a horizontal line after header and above footer.</p>
  
  <p>I have done it but I am unable to set its footer as I am going nuts with the alignment.</p>
  
  <p>Can anyone suggest me with this:</p>
  
  <p>CSS:</p>
  
  <pre><code>mainbody
  {
  position:absolute;
  Left:35%;
  top:20%;
  display:none;
  height:250px;
  width:500px;
  margin-top: 0;
  border:1px solid #fff;
  box-shadow:0px 2px 7px #292929;
  -moz-box-shadow: 0px 2px 7px #292929;
  -webkit-box-shadow: 0px 2px 7px #292929;
  border-radius:10px;
  -moz-border-radius:10px;
  -webkit-border-radius:10px;
  background-color:#ffffff;
  z-index:50;
  }
  
  
  .header
  {
      height: 30px;
      border-bottom: 1px solid #EEE;
      background-color: #ffffff;
      height: 40px;
      width: 490px;
      padding: 5px;
      -webkit-border-top-left-radius: 5px;
      -webkit-border-top-right-radius: 5px;
      -moz-border-radius-topleft: 5px;
      -moz-border-radius-topright: 5px;
      border-top-left-radius: 5px;
      border-top-right-radius: 5px;
  }
  
  
  .footer
  {
  width:500px;
  margin-bottom: 0;
  margin-top: 37px;
  margin-left:-5px;
  background-color: whiteSmoke;
  border-top: 1px solid #DDD;
  -webkit-border-bottom-right-radius:5px;
  -webkit-border-bottom-left-radius:5px;
  -moz-border-radius-bottomright:5px;
  -moz-border-radius-bottomleft:5px;
  border-bottom-right-radius:5px;
  border-bottom-left-radius:5px;            
  }
  </code></pre>
  
  <p>This is what I need:</p>
  
  <p><img src="https://i.stack.imgur.com/6Q71P.png" alt="enter image description here"></p>