我在用VS2008进行网页调试时候,用户登录模块有两个textbox 在运行显示和设计的不一样,其中一个比另一个长,两个长度不一致不知道是什么原因 我晕!请教各位??用户登录代码块:<div id="login_div">
 <div class="blank"></div>
 <div id="lb_username1">  <label for="userName">用户名:</label>  </div>
<div id="tb_username1">   
    <input id="Text1" type="text" /> </div>
<div id="lb_password1">    <label for="passWord">密码:</label></div>
<div id="tb_password1"><input id="Password1" type="password" /></div>
<div id="ibtn_login1" align="center">
     <asp:ImageButton ID="Login" ImageUrl=""  runat="server" />
     <asp:ImageButton ID="loginout" ImageUrl="" runat="server" />
</div>
<div id="login_help" align="center">
     <label for="forgetNum">忘记密码</label>&nbsp;<label for="register">注册新用户</label>
</div>
</div> CSS:/*纵向登录样式*/
#login_div { background-color:#FFD700; margin:0px 10px; width:160px;height:180px; }#lb_username1{ margin:0px 0px 2px 5px; height:auto; }#lb_password1{ margin:0px 0px 2px 5px;  height:auto; }#tb_username1{ margin:5px 0px 5px 5px;height:25px; }#tb_password1{ margin:5px 0px 5px 5px; height:25px; }#ibtn_login1{ margin:5px 0px 5px 0px;  height:30px; }#login_help{ margin:10px 0px 0px 0px; height:30px; }.blank{ height:10px; }我的浏览器是IE7以上 的,也不知与这有关没有。

解决方案 »

  1.   

    貌似是因为有一个是password
    把那个页面上的
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    这句话去掉看看的
      

  2.   

    产生这个情况应该是属于IE的一个BUG 默认情况下 文本框的字体和密码框的字体不相同导致的,所以只要加上一种字体问题就完美解决了!如:font-family:Arial, Helvetica, sans-serif
      

  3.   

    3楼正解 密码框的长度会短一些 font-family:Arial, Helvetica, sans-serif 可以解决
    也可以直接给这2个文本框设置width:200来解决