I am using this form setting for my login form :
<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>
when using firefox both input boxes having the same size. However when I am on IE 9 , the password field is smaller.
What is the best way to get rid of this behavior ?
Using password inputs. Password input boxes generally work just like other textual input boxes; the main difference is the obscuring of the content to prevent people near the user from reading the password.
The size attribute specifies the width of a password field (in number of characters). The default value is 20. Tip: To set or return the maximum number of characters allowed in the password field, use the maxLength property.
The size attribute specifies the width of a text field (in number of characters). The default value is 20.
The <input type="password"> defines a password field (characters are masked). Note: Any forms involving sensitive information like passwords should be served over HTTPS.
Use CSS to apply a fixed width
value to the elements, for example:
.fixed-input {
width: 150px;
}
....
<input class="fixed-input" id="id_username" type="text" name="username" maxlength="30" />
i was having the same problem. i added the width style and they still looked different.
it turned out that the padding and border color were also not the same for text and password inputs and this was causing the difference.
make sure you set the following style attributes for both password and text inputs:
width: 200px;
font-family: sans-serif;
font-size: 15px;
padding: 3px;
border: 1px solid black;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With