3

私の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です。

4

2 に答える 2

8

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">
于 2010-08-01T10:34:26.233 に答える
1

width: 150px;(CSSを使用して)修正できます。

CSSファイルの場合:

input {
  width: 150px;
}

またはインラインCSSで:style="width: 150px;"

編集:グリル:)。

于 2010-08-01T10:34:50.053 に答える