开发者

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;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜