i'm trying to use this code to make disabled inputs change color (they will be grey but i'm using red for debugging right now)

here is my code: input[disabled="disabled"],select[disabled="disabled"]{color:red;}

it works in FX and Safari, but is not working in IE7 or 8. according to documentation online this has been tested and works in IE.

can anyone shed light? am i doing something wrong?


  • what you have shown us looks okay, but you may have other errors that are affecting the outcome. can we see a test case url? http://www.developertutorials.com/blog/web/styling-disabled-buttons-disabled-text-boxes-in-css-404/ suggests your code is okay Tony Crockford almost 10 years ago

3 answers

Rob 230

It's very buggy in IE7 and probably might not work if those are class names. Can't remember about IE8 right now. Try looking at this test suite: http://meyerweb.com/eric/css/tests/css2/sec05-08-01.htm

Answered almost 10 years ago by Rob

To make sure that it works in all browsers i would add a class "disabled" to the elements. If you use Javascript just change the ClassName Attribute, that shouldn't be more complicated then setting the disabled Attribute :)

Answered almost 10 years ago by Sven Finke

found out what the issue was...IE7/8 is getting styles, so it is compatible, but when you use disabled="disabled", IE overrides any color styles with the grey color. But as a test i did text-dec:underline and that worked. So you can use this selector just know that you can't override the grey font color

Answered almost 10 years ago by dougmays