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

前端 未结 2 1279
误落风尘
误落风尘 2021-01-18 11:37

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],         


        
相关标签:
2条回答
  • 2021-01-18 11:50

    This is odd indeed. It seems that Safari shows the exact color black as gray in a disabled field, whereas other colors are obeyed. As a workaround, you could set color: #000001, but it isn’t quite black of course but has a shade of blue.

    As a different approach, consider why a field is set to disabled state, yet should be displayed in normal black color. For example, display it in normal text (and turn it to normal input field when you would now make the disabled field enabled).

    0 讨论(0)
  • 2021-01-18 11:55

    Try:

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

    This worked in Safari 7.

    0 讨论(0)
提交回复
热议问题