asp.net中的Div问题

asp.net中的Div问题,.net,css,html,.net,Css,Html,替换正文中的标记编码,如下图所示,然后重试 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8

替换正文中的标记编码,如下图所示,然后重试

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org>     
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <title>Ryan Merl's Portfolio</title>
 <style type='text/css'>
 .dataBold{
float:left;
padding:10px 0 0 80px; 
font-weight:bold;
  }
  .dataContact{ 
    height: 1%; 
    padding:10px 0 0 170px; 
    position:absolute;
   } 
   .data1{ 
    height: 1%; 
    padding:10px 0 0 550px; 
    position:absolute;

   } 


   .dataBold1
   {
            float:right;
        padding:10px 0 0 450px; 
        font-weight:bold;
        text-align: right;
        position:absolute;
    }



   </style>

   </head>
   <body>

   <div class="dataBold">
   <asp:Label ID="lblOffice" runat="server" Text="Office"/>  
   </div>
   <div class="dataContact">
   <asp:TextBox ID="txttitle" runat="server"></asp:TextBox>
   </div>
   <div class="dataBold1">
   <asp:Label ID="lblRegion" Text="Region"  runat="server"></asp:Label>
   </div>
   <div class="data1">
   <asp:DropDownList ID="ddlRegion" runat="server"></asp:DropDownList>
   </div>

   </body>
   </html>

问题在于您绝对定位的元素,以及您使用左填充样式定位它们的事实

这意味着您的区域
控件实际上出现在所有其他控件之上,阻止您单击文本框

如果你看看这个,这是你的HTML和Css。查看背景色如何显示html的实际层。 您需要更新html/css,不要使用绝对定位的元素,也不要更改元素的定位方式


这是一个如何使其正常工作的示例

页面运行良好,与运行nibg时的错误无关,但唯一的问题是文本框中的光标聚焦……。但是您没有在代码中添加带有runat=“server”的标记。请看我给你的密码。它的工作很好。不需要bcz,它从母版页继承而来,上面的代码在内容占位符中…………这就是你的html,工作很好。这都是你的标记/css吗?还是已经存在了?对不起,我忘了写两行代码……就像这样我现在编辑了检查。。。。。。。。。。。
       <form runat="server" >
       <div class="dataBold">
        <asp:Label ID="lblOffice" runat="server" Text="Office"/>  
       </div>
       <div class="dataContact">
        <asp:TextBox ID="txttitle" runat="server"/>
       </div>
       </form>