4 replies [Last post]
blueparukia
Offline
Enthusiast
Australia
Last seen: 12 years 12 weeks ago
Australia
Timezone: GMT+10
Joined: 2007-06-27
Posts: 63
Points: 0

I want to change the background colour and the text colour of a form I'm making.

input.text { background-color: #00688B; color: #DCDCDC }

select
{
background-color: #00688B;
color: #DCDCDC
}

textarea
{
background-color: #00688B;
color: #DCDCDC
}

Everything except:

input.text { background-color: #00688B; color: #DCDCDC }

Is working. Have I made a mistake? And for password fields I tried

input.password { background-color: #00688B; color: #DCDCDC }

but that didn't change anything. Any ideas or errors I have made?

Thanks,

BP

meforpnd
Offline
newbie
Ottawa, Canada
Last seen: 12 years 23 weeks ago
Ottawa, Canada
Joined: 2007-06-28
Posts: 6
Points: 0

Do you have your html

Do you have your html code?

I'm pretty sure I know what I'm saying but I use to only do basic css and just starting to do some more advanced. So correct me anyone if I'm wrong on this. For your "input.text" the "input" is at input tags but the ".text" is pointing to a class named text. For this the code would look like this:

But what you need is this:
input[type=text] {
background-color: #00688B;
color: #DCDCDC
}

I have seen the fallowing page with more information, the guy uses javascript to help with browser capabilities: http://cf-bill.blogspot.com/2005/05/styling-all-input-typetext-webpage.html

blueparukia
Offline
Enthusiast
Australia
Last seen: 12 years 12 weeks ago
Australia
Timezone: GMT+10
Joined: 2007-06-27
Posts: 63
Points: 0

Thanks, it worked

Thanks, it worked Laughing out loud

thepineapplehead
thepineapplehead's picture
Offline
Guru
Last seen: 1 year 16 weeks ago
Timezone: GMT+1
Joined: 2004-06-30
Posts: 9668
Points: 801

input.text will refer to any

input.text will refer to any INPUT element with a class of "text".

But you do know IE doesn't support the attribute selectors, right?

Verschwindende wrote:
  • CSS doesn't make pies

meforpnd
Offline
newbie
Ottawa, Canada
Last seen: 12 years 23 weeks ago
Ottawa, Canada
Joined: 2007-06-28
Posts: 6
Points: 0

thepineapplehead thanks for

thepineapplehead thanks for clarifying in such easy words.

That is why the other guy did a javascript to ensure it works in ie. But I think I would still use just input and add a class to the password fields if I would want them to be different.