Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing the background color of a disabled input field

Tags:

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;} 
like image 685
AnchovyLegend Avatar asked Dec 08 '12 18:12

AnchovyLegend


People also ask

How do you change the font color for disabled input?

Approach: With adding basic CSS property we are able to change the font-color of a disabled input. The disabled input element is unusable and un-clickable. This is a boolean attribute. Here using the color property of input we can change the font-color of this disabled input element.

What is the color of disabled textbox?

The background color for a disabled input in chrome is rgb(235,235,228) if that helps .. In firefox the disabled input background-color is F0F0F0.

How do I change the color of my disabled radio button?

An easy way to change the style of a disabled radio button is a simple absolute positioned overlay with the :after attribute. You can adjust the background color and borders as you see fit. Show activity on this post. Try adding the border colour as i believe thats the initial edge styling.


1 Answers

Try this instead:

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

Source: W3 schools

like image 110
zongweil Avatar answered Sep 21 '22 14:09

zongweil