div垂直和水平居中

<div id="div_1" style="width:100%; height:100%; z-index:1; overflow:hidden;padding-top:expression((this.offsetHeight-div_2.offsetHeight)/2);" align="center">
     <div id="div_2" style="width:800px; height:600px; z-index:1; overflow:hidden; border: 1px solid #58852a;padding-top:expression(this.style.top+(this.offsetHeight-div_3.offsetHeight)/2)" align="center">
      <div id="div_3" style="width:780px;height:580px;border:1px solid #58852a;padding-top:expression(this.style.top+(this.offsetHeight-tab_login.offsetHeight)/2)" align="center">
       <table border="0" cellpadding="0" id="tab_login" width="400">
        <tr>
         <td height="80" align="center" valign="middle"><span class="font_24">精彩</span><b>内容从这里诞生</b><label id="SetSystemDate"></label>
         </td>
        </tr>
        <tr>
         <td align="center">
          <table>
           <tr>
            <td height="40"><b>用户名</b></td>
            <td align="left"><input id="txtUsername" type="text" class="input"></td>
           </tr>
           <tr>
            <td height="40"><b>密码</b></td>
            <td align="left"><input id="txtPassword" type="password" class="input"></td>
           </tr>
           <tr>
            <td height="40" colspan="2">
             <input type="submit" value="编辑工作平台登陆" style="width:205px">
            </td>
           </tr>
          </table>
         </td>
        </tr>
       </table>
      </div>
     </div>
    </div>

你可能感兴趣的:(div)