I have an issue with a text and password input box on a form.

Even though I have set both widths to 40px, in IE they appear different lengths.

As always it's fine in Firefox, just have the problem with IE.

Can anyone tell me how I might resolve this?

  • url, so we can see the code? Tony Crockford about 7 years ago
  • And which version of IE that would be? joneff about 7 years ago

5 answers

0
points
This was chosen as the best answer

You can use the attribute selector.

input[type="password"] {style}
input[type="text"] {style}
Answered about 7 years ago by Ben Shoults
  • Note that IE6 does not support attribute selectors though. Richard Grevers about 7 years ago
  • Sorry, forgot to mention that. If IE5.5 and 6 are an issue for you then you could use a class, less elegant, but would get the job done. Ben Shoults about 7 years ago
0
points

In the absence of hard code, I would use an IE stylesheet and give that a different width - IE box model and padding is most likely the culprit here.

Answered about 7 years ago by Tony Crockford
0
points

Sound good, but how would I style a text input box differently from a password input box?

Answered about 7 years ago by Andrew Turner
  • Please use comments for comments on answers and questions, thanks! Matthew Brindley about 7 years ago
0
points

Just to clarify - I enter this into the CSS file?

Answered about 7 years ago by Andrew Turner
0
points

OK, it's sorted. I did just have to put this in the CSS file. Many thanks.

Answered about 7 years ago by Andrew Turner