Safari CSS Font Color issue

后端 未结 2 1575
囚心锁ツ
囚心锁ツ 2020-12-25 15:04

I\'m having a problem with my font color in safari browser on mac book, iphone and ipad. The disable element turn into gray and I want it to retain its original color black.

相关标签:
2条回答
  • 2020-12-25 15:28

    You could try set it to anything but solid black such as #00001 or #000002 in order to get around the issue as safari tries to override it.

    input[disabled], textarea[disabled],
    select[disabled='disabled']{
        color: #000001 !important;
    }
    
    0 讨论(0)
  • 2020-12-25 15:37

    This is the only solution I found that works on FF, Chrome, Safari and Safari Mobile. Cheers!

    input[disabled], textarea[disabled],
    select[disabled='disabled']{
       -webkit-text-fill-color: rgba(0, 0, 0, 1); 
       -webkit-opacity: 1; 
       color: rgba(0, 0, 0, 1); 
       background: white;
    }
    
    0 讨论(0)
提交回复
热议问题