colored text box

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I have created a very simple form
<form name="form1" method="post" action="" style="font-size:0.75em;">
  e-mail <input type="text" name="textfield" size="15">
  &nbsp;&nbsp;password <input type="password" name="textfield"
  &nbsp;&nbsp;<input type="submit" name="Submit" value="sign in">

But when I come to view it in a browser (IE6) thee-mail text box has a
colored backround.

Any explanation, and how do i get rid of the color?

Re: colored text box


Quoted text here. Click to load it

It's simply incorrect. The effect is undefined for form with action="".

It's also very poorly formatted. Many browsers already use too small font
size for input fields (using input, textarea, option, button { font-size:
100%; } in CSS fixes this, provided of course that you don't mess around
with the overall font size). No need to make things worse by reducing the
font size of textual labels by 25%. Besides, each label/field pair should
appear on a line of its own, have <label> markup, and not use no-break
spaces for formatting. Moreover, a visible width of 15 characters is too
little for a typical email address (did you count the characters in yours?)
and too much for a typical password field (usually at most 8 or 10 first
characters are significant).

Quoted text here. Click to load it

I suppose Adrienne's explanation is correct, but you could try

input.txt { background: white; color: black; }


<input type="text" class="txt" ...>

(By CSS specs, you could dispense with the class attribute and use an
attribute selector:
input[type="text"] { background: white; color: black; }
but IE 6 won't understand it. IE 7 does.)

Jukka K. Korpela ("Yucca")

Site Timeline