How to fix the size of the password input field?

my html code

<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>

but the problem is that the length of the password text field is different in IE, means the uidsize 20, but the size passis about 17.

+3
source share
2 answers

Try using style="width:200px", not setting the size this way.

<input type="text" id="uid" style="width:200px;">
<input type="password" id="pass" style="width:200px;">

Or you can create a class in CSS as follows:

.input{
  width:200px;
}

And use like this:

<input type="text" id="uid" class="input">
<input type="password" id="pass" class="input">
+8
source

You can fix it using width: 150px;(using CSS).

In the CSS file:

input {
  width: 150px;
}

Or embedded the CSS: style="width: 150px;".

Edit: Roasted :).

+1
source

Source: https://habr.com/ru/post/1757535/


All Articles