`

IE下input类型为text和password的长度不一致问题

    博客分类:
  • SSH
 
阅读更多

 

2009-11-05 09:56:05|  分类: Web|举报|字号 订阅

 
 

       原因是源于字体,password默认是英文字体,而text默认为定义的字体或者中文字体(我想这是在中文环境下的原因),所以说便出现了长度不一致。解决的方案有二:
1.为input设置font-family英文字体

input {

 font-family:'Verdana';

}

2.将text和password的width属性设置为相同的宽度值

<input   name="textinput"   type="text"   size="30"   maxlength="12"     style="width:200px">
<input   name="passwordinput"   type="password"   size="30"   maxlength="12"   style="width:200px">
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics