asp.net中如何让网页在不同的分辨率下都显示在屏幕的正中间

解决方案 »

  1.   

    aspx页面里的基本结构如下
    <from>
    <div>
    </div>
    </form>在页面里引入个css,例如
    <link href="css.css">
    css文件中定义如下:
    .area{
        width:1000px; height:1000px; text-algin:center(这是IE中的句中语法); margin-left:auto; margin-right:auto(这是firefox等浏览器的居中语法)
    }
    然后在div层中引用。
    <from>
    <div class="area">
    </div>
    </form>
    css文件中其他属性根据自己需要定义。
      

  2.   

    <body>
    <center></center>
    ...
      

  3.   

    body
    {
    padding: 0px;
    font-size: 12px;
    margin: 0px;
    color: #444;
    font-family: Calibri;
    text-align: center;
    }form
    {
    width: 1003px;
    text-align: justify;
    }这是我用的方法,在你的CSS文件中加入上面的代码,当然只有body{text-align: center;}和form{width: 1003px;}是实现你的功能用的。这样写完一后,所有的页都居中了,不用一页一页的设。
      

  4.   

    好像关键就是margin-left:auto;margin-right:auto吧?
      

  5.   

    就是css的设置问题;
    body{text-align: center;}
      

  6.   

    http://topic.csdn.net/u/20080723/18/9f5914e8-42d8-45f2-998f-6d2bca828536.html
      

  7.   

    <body>
        <form id="form1" runat="server">
            <div style="text-align: center">
                <!--页面布局开始-->
                <table>
                    <tr>
                        <td>
                        </td>
                    </tr>
                </table>
                <!--页面布局结束 -->
            </div>
        </form>
    </body>