views:

778

answers:

2

I'm trying to change the color of input controls when they are disabled using the following css.

input[disabled='disabled']{
  color: #666;     
}

This works in most browsers, but not IE. I'm able to change any of the other style properties such as background-color, border-color, etc... just not color. Can anyone explain this?

+4  A: 

Unfortuntely if you use the disabled attribute, no matter what you try IE will just default the colour of the text to grey, with a wierd white shadow...thing... yet all other styles will still work. :-/

Wayne Austin
Yea, but why? Is it using some non-standard filter style behind the scenes or something?
Seth Reno
I almost voted this answer down, but I stopped myself. I was going to do it because I hated the answer; not because the answer was wrong. Voting up :p
spudly
A: 

The way I solved the problem of "disabling" a control in IE w/o the ugly gray with a input control of type = checkbox was to leave it enabled and use a little javascript in the onclick event to prevent changes:

onclick='this.checked == true ? this.checked = false : this.checked = true;'
Booji Boy