Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is text in disabled form elements not rendered in black in Safari?

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.

like image 925
Tintin81 Avatar asked Jan 27 '13 13:01

Tintin81


People also ask

How do I change the color of 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.

How to CSS for disabled?

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.


1 Answers

Try:

-webkit-text-fill-color: #000000;

This worked in Safari 7.

like image 121
Florin Dobre Avatar answered Oct 04 '22 16:10

Florin Dobre