title: JSP / Javascript / CSS : auto resize div based on window size
body: <p>I created a "master page" in jsp using frameset, and I included the master page in my other jsps where i have a  in the  where the contents will be. How can I change the size of the  whenever the window size changes? </p>
  
  <p>Below is my sample code :</p>
  
  <p>masterPage.jsp</p>
  
  <pre><code>&lt;html&gt;
  &lt;frameset style="border: 0;" rows="135,*,38" style="z-index:1" &gt;
      &lt;frame id="headerFrame" noresize="noresize" name="ffwHeader" frameborder="0" scrolling="no" src="header.jsp" style="z-index:1" /&gt;
      &lt;frame name="ffwMenu" frameborder="0" scrolling="no" src="menu.jsp" style="z-index:3" /&gt;
      &lt;frame name="ffwFooter" noresize="noresize" frameborder="0"  scrolling="no" src="footer.jsp" style="z-index:1" /&gt;
  &lt;/frameset&gt;
  </code></pre>
  
  <p></p>
  
  <p>index.jsp</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Upload A Disposition Rule&lt;/title&gt;
      &lt;style type="text/css"&gt;
          html, body, div, iframe { margin:0; padding:0; height:100%; }
          iframe { display:block; width:100%; border:none; }
      &lt;/style&gt;
  &lt;/head&gt;
  
  &lt;body &gt;
      &lt;div id="bodydiv" align="center" style="position:fixed; top:135px;left:182px; z-index:2; bottom: 38px;  height:  510px; width: 1080px; overflow: auto; "&gt;
          &lt;!--contents--&gt;
      &lt;/div&gt;
      &lt;iframe src="masterPage.jsp" name="masterPage" /&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>
  
  <p>Thanks in advance.</p>