I need to change the style for a disabled input element in CSS.
<input type="text" class="details-dialog" disabled="disabled" />
How I can do this for Internet Explorer?
I think what you really want to do is enable the TextBox and set the ReadOnly property to true . It's a bit tricky to change the color of the text in a disabled TextBox . I think you'd probably have to subclass and override the OnPaint event. ReadOnly though should give you the same result as !
The background color for a disabled input in chrome is rgb(235,235,228) if that helps .. In firefox the disabled input background-color is F0F0F0.
You can't for Internet Explorer.
See this comment I wrote on a related topic:
There doesn't seem to be a good way, see: How to change color of disabled html controls in IE8 using css - you can set the input to
readonly
instead, but that has other consequences (such as withreadonly
, theinput
will be sent to the server on submit, but withdisabled
, it won't be): http://jsfiddle.net/wCFBw/40
Also, see: Changing font colour in Textboxes in IE which are disabled
You can:
input[type="text"][disabled] { color: red; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With