AnchovyLegend
AnchovyLegend

Reputation: 12538

Changing the background color of a disabled input field

I am trying to find a way to disable the background color of a disabled input field. I was wondering if someone can help me with this?

This is what I tried, which did not work:

 input[type="text"][disabled]{background-color:red;}

Upvotes: 27

Views: 69608

Answers (2)

David
David

Reputation: 133

You can use this to catch all input types

input:disabled {
   background-color: red;
}

Upvotes: 2

zongweil
zongweil

Reputation: 2051

Try this instead:

input[type="text"]:disabled{background-color:red;}

Source: W3 schools

Upvotes: 65

Related Questions