sikas
sikas

Reputation: 5523

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="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?

Upvotes: 3

Views: 27017

Answers (3)

miqbal
miqbal

Reputation: 2227

It's possible.

input:disabled {
  background: #000;
}

Upvotes: 1

ajreal
ajreal

Reputation: 47321

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

Upvotes: 6

Aravind Yarram
Aravind Yarram

Reputation: 80176

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
}

Upvotes: 3

Related Questions