<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="dl.aspx.cs" Inherits="_Default" %><!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 runat="server">
    <title>无标题页</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        &nbsp;<br />
        <asp:Label ID="Label1" runat="server" Style="left: 227px; position: relative; top: -86px"
            Text="用户名"></asp:Label>&nbsp;<table border="1" cellpadding="0" cellspacing="0" style="left: 194px;
                width: 294px; position: relative; top: 8px">
                <tr>
                    <td style="width: 100px; font-weight: bold; font-size: 18px; color: green; height: 22px;" colspan=2 align="center" >
                        用户登陆</td>
                    
                </tr>
                <tr>
                    <td style="width: 99px; height: 26px;" align="right">
                        用户名:</td>
                    <td style="width: 100px; height: 26px;" align="left">
                        <asp:TextBox ID="TextBox2" runat="server" Style="left: 0px; position: relative; top: 0px"
                            Width="120px"></asp:TextBox></td>
                </tr>
                <tr>
                    <td style="width: 99px; height: 25px;" align="right">
                        密 &nbsp; 码:</td>
                    <td style="width: 100px; height: 25px;" align="left">
                        <asp:TextBox ID="TextBox1" runat="server" Style="left: 1px; position: relative; top: 0px"
                            Width="119px"></asp:TextBox></td>
                </tr>
                <tr>
                    <td style="width: 100px; height: 26px;" colspan=2 align="center" >
                        <asp:Button ID="Button1" runat="server" Style="left: 63px; position: relative; top: 0px"
                            Text="下一步" /></td>
                  
                </tr>
            </table>
        &nbsp; &nbsp;
        <asp:Label ID="Label3" runat="server" Style="left: -119px; position: relative; top: -132px"
            Text="用户登陆"></asp:Label>
        <br />
        <br />
        <br />
    
    </div>
    </form>
</body>
</html>

解决方案 »

  1.   

    不用加太多东西<style type="text/css">
    <!--
    .tab td {text-align:center;}
    -->
    </style>把这个复制到<head></head>里去
    把你的 <table 加一个  class="tab" 即可<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tab">……
      

  2.   

    运行页面的时候,panel在网页中间
      

  3.   

    google搜索下最新日期控件  会发现你所要的
      

  4.   

    把顶部<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    改为:<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      

  5.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><!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 id="Head1" runat="server">
        <title>无标题页 </title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            &nbsp; <br />
            <table border="1" cellpadding="0" cellspacing="0" style="left: 194px;
                    width: 250px; position: relative; top: 8px">
                    <tr>
                        <td style="width: 250px; font-weight: bold; font-size: 18px; color: green; height: 22px;" colspan=2 align="center" >
                            用户登陆</td>
                       
                    </tr>
                    <tr>
                        <td style="width: 100px; height: 26px;" align="right">
                            用户名:</td>
                        <td style="width: 150px; height: 26px;" align="left">
                            <asp:TextBox ID="TextBox2" runat="server" Style="left: 0px; position: relative; top: 0px"
                                Width="120px"> </asp:TextBox> </td>
                    </tr>
                    <tr>
                        <td style="width: 100px; height: 25px;" align="right">
                            密 码:</td>
                        <td style="width: 150px; height: 25px;" align="left">
                            <asp:TextBox ID="TextBox1" runat="server" Style="left: 1px; position: relative; top: 0px"
                                Width="119px"> </asp:TextBox> </td>
                    </tr>
                    <tr>
                        <td style="width: 250px; height: 26px;" colspan=2 align="center" >
                            <asp:Button ID="Button1" runat="server" Style="left: 65px; position: relative; top: 0px"
                                Text="下一步" /> </td>
                     
                    </tr>
                </table>
            <br />
            <br />
            <br />
       
        </div>
        </form>
    </body>
    </html> 
      

  6.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><!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 id="Head1" runat="server">
        <title>无标题页 </title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div  align="center">
            &nbsp; <br />
            <table border="1" cellpadding="0" cellspacing="0" style="
                    width: 250px; margin-top:20%">
                    <tr>
                        <td style="width: 250px; font-weight: bold; font-size: 18px; color: green; height: 22px;" colspan=2 align="center" >
                            用户登陆</td>
                       
                    </tr>
                    <tr>
                        <td style="width: 100px; height: 26px;" align="right">
                            用户名:</td>
                        <td style="width: 150px; height: 26px;" align="left">
                            <asp:TextBox ID="TextBox2" runat="server" Style="left: 0px; position: relative; top: 0px"
                                Width="120px"> </asp:TextBox> </td>
                    </tr>
                    <tr>
                        <td style="width: 100px; height: 25px;" align="right">
                            密 码:</td>
                        <td style="width: 150px; height: 25px;" align="left">
                            <asp:TextBox ID="TextBox1" runat="server" Style="left: 1px; position: relative; top: 0px"
                                Width="119px"> </asp:TextBox> </td>
                    </tr>
                    <tr>
                        <td style="width: 250px; height: 26px;" colspan=2 align="center" >
                            <asp:Button ID="Button1" runat="server" Style="left: 65px; position: relative; top: 0px"
                                Text="下一步" /> </td>
                     
                    </tr>
                </table>
            <br />
            <br />
            <br />
       
        </div>
        </form>
    </body>
    </html> 你用这个代码是你要的效果么?
      

  7.   

    哈哈,我知道,你把<td style="width: 100px; 的这个去掉就行拉
      

  8.   

    <td style="width: 250px; font-weight: bold; font-size: 18px; color: green; height: 22px;" colspan=2 align="center" > 
                            用户登陆 </td> 红色的去掉.
      

  9.   

    去掉Style="left: 227px; position: relative; top: -86px" 把<td style="width: 250px; font-weight: bold; font-size: 18px; color: green; height: 22px;" colspan=2 align="center" > 中这种什么width:250px  position等等去掉就可以了
      

  10.   

    <panel>可以放在<div>中就能居中了.
      

  11.   

    <td width="xxxxxx" align="center" colspan=.....................
    你用style 都把样式搞混了 
      

  12.   

    最好的就是去掉style样式,这样就万事OK了。