HTML text color in disabled text box
I have a text box
in html, I have set the text box
to disabled
,
<input type="text" style="开发者_StackOverflow社区background-color:transparent; text-align:center" disabled="disabled" />
So the text color in this text box
is gray, how can I change it to any color I want?
color:xxx
and provide some value for the textbox
<input type="text" style="background-color:transparent; color:red;
text-align:center" disabled="disabled" value="some values"/>
work for chrome, firefox, except internet explorer
You can try with css selectors as shown below but as "Sarfarz" mentioned browsers might or might not honor this. But you can test
input[disabled='disabled']
{
...styles
}
It's possible.
input:disabled { background: #000; }
精彩评论