<body ms_positioning="FlowLayout"……

解决方案 »

  1.   

    <div align="center" width="100%">
    ...
    </div>或者<table aligh="center" width="100%">
    ...
    </table>
      

  2.   

    你应该做一个Table,把所有东西都放在Table中,然后再设置Table的宽度为100%,行居中。
      

  3.   

    <center>.....</center>no absolute position
      

  4.   

    将所有的控件的绝对位置样式都去掉,就是style中的东西,
    再将<body ms_positioning...中的ms_positioning及后面的东西去掉,
    只剩<body>
    最后再用<div align=center>......</div>
      

  5.   

    创建一个一行一列的table(web窗体中的),边框大小设置为0,宽度选为100 百分比
    <td align="center">XXXXXX</td>
    XXXXXX为你想居中的控件
      

  6.   

    用Div肯定可以的,看看你有什么东东和你的Div冲突
      

  7.   

    <div align="center">
    xxxx
    </div>
      

  8.   

    先修改body中的 ms_positioning属性,然后再用div 或者table控制居中
      

  9.   

    <body><div align="center"><div></body>
      

  10.   

    <asp:label id="Label1" style="Z-INDEX: 124; LEFT: 240px; POSITION: absolute; TOP: 147px; TEXT-ALIGN: center" runat="server" Font-Names="Verdana" Font-Size="9pt" Width="129px">Care Recipient ID</asp:label>
      

  11.   

    <asp:label id="Label1" style="Z-INDEX: 124; LEFT: 240px; POSITION: absolute; TOP: 147px; TEXT-ALIGN: center" runat="server" Font-Names="Verdana" Font-Size="9pt" Width="129px">Care Recipient ID</asp:label>
      

  12.   

    <asp:label id="Label1" style="Z-INDEX: 124; LEFT: 240px; POSITION: absolute; TOP: 147px; TEXT-ALIGN: center" runat="server" Font-Names="Verdana" Font-Size="9pt" Width="129px">Care Recipient ID</asp:label>
      

  13.   

    我的代码是这样的,他就是不能居中。
    <body MS_POSITIONING="GridLayout">
    <div align ="center">
    <form id="Form1" method="post" runat="server">
    <FONT face="宋体">
    <asp:TextBox id="TextUser" style="Z-INDEX: 101; LEFT: 312px; POSITION: absolute; TOP: 224px"
    runat="server" Width="144px" Height="18px"></asp:TextBox>
    <asp:TextBox id="TextPass" style="Z-INDEX: 102; LEFT: 312px; POSITION: absolute; TOP: 264px"
    runat="server" Width="144px" TextMode="Password" Height="18px"></asp:TextBox>
    <asp:Button id="Button2" style="Z-INDEX: 103; LEFT: 480px; POSITION: absolute; TOP: 264px" runat="server"
    Width="41px" Text="确定" Height="24px"></asp:Button>
    <asp:Image id="Image1" style="Z-INDEX: 104; LEFT: 256px; POSITION: absolute; TOP: 96px" runat="server"
    Width="256px" Height="64px" ImageUrl="logo.jpg"></asp:Image>
    <asp:Label id="Label1" style="Z-INDEX: 105; LEFT: 240px; POSITION: absolute; TOP: 176px" runat="server"
    Width="328px" Height="24px" Font-Bold="True">Welcome to Polymorph Storage System</asp:Label>
    <asp:Label id="Label2" style="Z-INDEX: 106; LEFT: 256px; POSITION: absolute; TOP: 344px" runat="server"
    Width="280px" Font-Size="X-Small" Font-Underline="True">Copyright 2000-2004 Polymorph Work Group </asp:Label></FONT>
    </form>
    </div>
    </body>
      

  14.   

    <div align="center">是用于调节div内元素相对div的位置,而不是用于调节div在页面
    上的位置。
    你要让div显示在中间,有两种方法:
    1。设置div的style属性:如style="LEFT: 500px; WIDTH: 78px; POSITION: absolute; TOP: 500px; HEIGHT: 59px",调节top和left属性
    2。将div放在一个table或另一个div中,设置table的align属性,如下:<table style="WIDTH: 300px; HEIGHT: 300px">
          <tr>
    <td align="center">
    <div align="center" style=" LEFT: 500px; WIDTH: 78px; TOP: 500px; HEIGHT: 59px">
    <INPUT style="WIDTH: 13px; HEIGHT: 20px" type="checkbox" value="show" id="Checkbox2" title="show" name="Checkbox2" runat="server">&nbsp;
    </div>
    </td>
         </tr>
    </table>
      

  15.   

    把这些绝对定位的代码都去掉啊!style="Z-INDEX: 101; LEFT: 312px; POSITION: absolute; TOP: 224px
      

  16.   

    这样就可以了:<body MS_POSITIONING="GridLayout">
    <form id="Form1" method="post" runat="server" onsubmit="return Charactor_Check();">
    <table id="tbl" align="center" width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td align="middle">
    <asp:Image id="Image1" runat="server" Width="256px" Height="64px" ImageUrl="logo.jpg"></asp:Image>
    </td>
    <tr>
    <td align="middle">
    <asp:Label id="Label1" runat="server" Width="328px" Height="24px" Font-Bold="True">Welcome to Polymorph Storage System</asp:Label>
    </td>
    </tr>
    <tr>
    <td align="middle">
    <asp:TextBox id="TextUser" runat="server" Width="144px" Height="18px"></asp:TextBox>
    </td>
    </tr>
    <tr>
    <td align="middle">
    <asp:TextBox id="TextPass" runat="server" Width="144px" TextMode="Password" Height="18px"></asp:TextBox>
    <div style="position:absolute;"><asp:Button id="Button2" runat="server" Width="41px" Text="确定" Height="24px"></asp:Button></div>
    </td>
    </tr>
    <tr>
    <td align="middle">
    </td>
    </tr>
    <tr>
    <td align="middle">
    <asp:Label id="Label2" runat="server" Width="280px" Font-Size="X-Small" Font-Underline="True">Copyright 2000-2004 Polymorph Work Group </asp:Label></FONT>
    </td>
    </tr>
    </table>
    </form>
    </body>