Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change font-color for disabled input?

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?

like image 869
isxaker Avatar asked May 31 '11 11:05

isxaker


People also ask

How do I change the color of a disabled text box?

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 !

What is the color of disabled input?

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.


2 Answers

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 with readonly, the input will be sent to the server on submit, but with disabled, it won't be): http://jsfiddle.net/wCFBw/40

Also, see: Changing font colour in Textboxes in IE which are disabled

like image 166
thirtydot Avatar answered Oct 24 '22 15:10

thirtydot


You can:

input[type="text"][disabled] {    color: red; } 
like image 27
Alex K. Avatar answered Oct 24 '22 14:10

Alex K.