我的html代码是
<tr>
<td>User ID:</td>
<td><input type="text" id="uid" size="20"></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" id="pass" size="20"></td>
</tr>
<tr>
但问题是,密码文本框的长度在 IE 中有所不同,意味着
uid
大小为 20
但 pass
大小约为 17
。
例如尝试使用
style="width:200px"
而不是以这种方式指定尺寸。
<input type="text" id="uid" style="width:200px;"> <input type="password" id="pass" style="width:200px;">
或者你可以在 CSS 中创建一个类,如下所示:
.input{
width:200px;
}
并像这样使用:
<input type="text" id="uid" class="input">
<input type="password" id="pass" class="input">
您可以使用
width: 150px;
(使用 CSS)修复它。
在 CSS 文件中:
input {
width: 150px;
}
或者在内联 CSS 中:
style="width: 150px;"
.
编辑:烤:).
以上方法无法解决问题。这是由 Google Chrome 的自动填充密码功能引起的,但我不知道如何解决。