开发者

HTML text color in disabled text box

开发者 https://www.devze.com 2023-02-01 19:27 出处:网络
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\" />

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

精彩评论

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