【问题标题】:Change text color for input text in html when it is in disabled in IE8在 IE8 中禁用时更改 html 中输入文本的文本颜色
【发布时间】:2014-03-06 03:57:47
【问题描述】:

在 IE8 中,它显示为浅灰色,几乎不可读。 Chrome 和 Firefox 都很好。我该如何解决?

【问题讨论】:

    标签: css html


    【解决方案1】:

    试试这个

    input[type=text]:disabled
    {
      color:red
    }
    

    【讨论】:

      【解决方案2】:

      由于 IE7 及更高版本支持 [attr] 选择器,您可以执行 answered here 的操作。

      input[disabled]
      {
        color: red;
      }
      

      希望这会有所帮助。我无法测试它,因为我在 Windows 7 上并且只有 IE10。

      【讨论】:

        【解决方案3】:

        你可以使用jQuery:

        $('input[type=text]:disabled').css({
            'color' : 'red'
        });
        

        CSS:

        input[type=text]:disabled
        {
           color:red
        }
        

        我强烈推荐CSS :D

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2020-04-24
          • 1970-01-01
          • 1970-01-01
          • 2023-04-04
          • 2011-12-25
          • 1970-01-01
          • 2020-09-08
          • 1970-01-01
          相关资源
          最近更新 更多