By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,624 Members | 2,179 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,624 IT Pros & Developers. It's quick & easy.

colored text box

P: n/a
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"
size="15">
&nbsp;&nbsp;<input type="submit" name="Submit" value="sign in">
</form>

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?

Feb 21 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Scripsit ab**********@yahoo.com:
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"
size="15">
&nbsp;&nbsp;<input type="submit" name="Submit" value="sign in">
</form>
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 <labelmarkup, 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).
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?
I suppose Adrienne's explanation is correct, but you could try

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

with

<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")
http://www.cs.tut.fi/~jkorpela/

Feb 21 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.