![](/img/trans.png)
[英]Internet Explorer 10 Windows 8 Remove Text Input and Password Action Icons
[英]HTML text and password input fields have difference size internet explorer
我在登錄表單中使用此表單設置:
<tr>
<td class="label"> Username:</td>
<td> <input id="id_username" type="text" name="username" maxlength="30" /></td>
</tr>
<tr>
<td class="label"> Password:</td>
<td> <input a="text" type="password" name="password" id="id_password" /></td>
</tr>
當使用firefox兩個具有相同大小的輸入框時。 但是,當我在IE 9上時,密碼字段較小。
擺脫這種行為的最佳方法是什么?
使用CSS將固定width
值應用於元素,例如:
.fixed-input {
width: 150px;
}
....
<input class="fixed-input" id="id_username" type="text" name="username" maxlength="30" />
我遇到了同樣的問題。 我添加了寬度樣式,但它們看起來仍然不同。
事實證明,文本和密碼輸入的填充和邊框顏色也不相同,這導致了差異。
確保為密碼和文本輸入設置以下樣式屬性:
width: 200px;
font-family: sans-serif;
font-size: 15px;
padding: 3px;
border: 1px solid black;
最好的方法是為這些元素定義樣式並設置適當的寬度。 maxlength屬性可能會增加用戶字段的大小。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.