I am trying to get the text inside disabled input elements to show up in black. This works in most browsers:
input[type="text"][disabled],
input[type="text"]:disabled {
color: #000000;
}
In Safari (version 6.0.2), however, the text is slightly brighter. What puzzles me most is that when I select the text in my browser and look up the element information on my console it clearly shows:
rgba(0,0,0)
So in the code it is black but nonetheless it is rendered in something other than black. How is this possible?
Is this a Safari bug?
Thanks for any help in this matter.
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 :disabled CSS pseudo-class represents any disabled element. An element is disabled if it can't be activated (selected, clicked on, typed into, etc.) or accept focus. The element also has an enabled state, in which it can be activated or accept focus.
Try:
-webkit-text-fill-color: #000000;
This worked in Safari 7.
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