PDA

View Full Version : input text color problem



masterofollies
Feb 19th, 2010, 01:29 AM
I am using the following code to color in the textboxes.


input[type="text"]
{
background-color: #CD2626;
color: #FFFFFF;
font-weight: bold;
}
input[type="password"]
{
background-color: #CD2626;
color: #FFFFFF;
font-weight: bold;
}

Now this works fine for FireFox. The inputs are red. But in IE the inputs are white. I also use this code for two select boxes


select
{
background-color: #CD2626;
color: #FFFFFF;
font-weight: bold;
}

That works great in both browsers. But how can I get it to work in IE for the text and password boxes? Here is a link to it.

http://www.rodgame.org/reg2.html

abduraooft
Feb 19th, 2010, 08:11 AM
Now this works fine for FireFox. The inputs are red. But in IE the inputs are white. IE6 doesn't recognise attribute selectors. Apply a class on the required fields and then use that class selector to target the elements.

PS: IE's support on styling a <select> element is limited.

masterofollies
Feb 19th, 2010, 03:23 PM
So you mean like this?


<input type="text" class="newtext" name="username" value="">

Then put a class in the CSS called newtext and do a background color for it?

abduraooft
Feb 19th, 2010, 03:29 PM
Yeah (, but a meaningful class name is recommended :))

masterofollies
Feb 20th, 2010, 01:00 AM
For some odd reason......it worked? Haha thanks! :D