How to style a disabled text area in IE8?

What rule do you need to enable styling of disabled items in IE8? I have the code below. This works well under IE7, but not on IE8. IE8 just give me the cover. Why?

input[disabled], input:disabled, textarea[disabled], textarea[disabled="disabled"], textarea:disabled { background:#EBEBE4; } 
+16
css internet-explorer-8
Mar 30 '11 at 11:25
source share
2 answers

: pseudo-class in the selector is disabled IE8!

you need to ungroup these selectors if you absolutely need to use those CSS3 pseudo classes ;

If there is a selector in the rule set that IE8 does not understand, ignoring all this - this is common in IE8 with CSS3 pseudo-classes

eg. If you separate them and completely remove the :disabled selector parts, you will see that the first example below works for everyone, while the second still works, except for IE7

 input[disabled], select[disabled], textarea[disabled] {background-color: #0f0;} /* lime green - works in IE7+ and modern browsers */ input[disabled="disabled"], select[disabled="disabled"], textarea[disabled="disabled"] {background-color:#ff0;} /* yellow - IE8+ and modern browsers */ 

the color issue (as opposed to the background color) mentioned in another answer is not the cause of your problem, but that would not help if you also tried to change the color;)

+32
Mar 30 '11 at 12:19
source share

Another option is to add the disabled class and its style:

 input.disabled, textarea.disabled{ background:#EBEBE4; } 
+5
Mar 30 '11 at 11:27
source share



All Articles