zoukankan      html  css  js  c++  java
  • 网页垂直居中

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <style type="text/css">
    <!--
    .kkkk {
    background-color: #CCCCCC;
     
    }
    body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
    }
    -->
    </style>
    </head>
     
    <body>
     
      <table width="100%" border="1" cellpadding="0" cellspacing="0" class="kkkk" id="mainDiv">
        <tr>
          <td align="center" valign="middle"><table width="200" border="1" cellspacing="0" cellpadding="0">
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
            </table></td>
        </tr>
      </table>
     
    <script type="text/javascript" language="javascript">
    function OnResize()
    {
    window.document.getElementByIdx("mainDiv").style.height=document.documentElement.clientHeight + "px";
    }
    OnResize();
    window.onresize = OnResize;
    </script>
    </body>
    </html>
     
  • 相关阅读:
    [CF1462F] The Treasure of The Segments
    [CF1466E] Apollo versus Pan
    SYZOJ 搭建 Note
    [CF1476D] Journey
    [CF1476E] Pattern Matching
    [CF1494D] Dogeforces
    [CF1383B] GameGame
    [CF1383A] String Transformation 1
    [CF1453D] Checkpoints
    [CF1453C] Triangles
  • 原文地址:https://www.cnblogs.com/dcrenl/p/4041167.html
Copyright © 2011-2022 走看看