html页面高度自适应

本文实现的效果是依据浏览器分辨率的不同。页面底端背景色自适应浏览器高度,也就是能够自己主动填充背景色。

<script type="text/javascript">

function height_adaptive(){
  var main=$(document).height();
  var title=document.getElementById("login_title").scrollHeight;
  var body=document.getElementById("login_body").scrollHeight;
  var bottom=main-title-body;
  $("#login_bottom").height(bottom);
 }
  </script>

<BODY >

<form  method="post" action="login.action" name="frm" >
  <div >
 <span >mindray | OR Digital System</span>
  </div>
  <div >
  <div align="left" class="login_head">
  <img >
 </div>
 <table cellspacing="10px" style="padding-top:278px">
  <tr>
   <td><input type="text" /></td>
  </tr>
  <tr>
   <td><input type="password" /></td>
  </tr>
  <tr>
   <td align="left"><img
     onmousedown="rem_mousedown()" onmouseup="rem_mouseup()">
   <span >&nbsp;Remember me</span></td>
  </tr>
 </table>
  </div>
  <div >
 <br />
 <button type="button" >Log in</button>
  </div>

</FORM>
</BODY>