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;}
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.
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.
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.
Try this instead:
input[type="text"]:disabled{background-color:red;}
Source: W3 schools
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With