如何使用 css 更改 IE8 中禁用的 html 控件的颜色 [英] How to change color of disabled html controls in IE8 using css

查看:24
本文介绍了如何使用 css 更改 IE8 中禁用的 html 控件的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当输入控件被禁用时,我正在尝试使用以下 css 更改它们的颜色.

I'm trying to change the color of input controls when they are disabled using the following css.

input[disabled='disabled']{
  color: #666;     
}

这适用于大多数浏览器,但不适用于 IE.我可以更改任何其他样式属性,例如背景颜色、边框颜色等……只是不是颜色.谁能解释一下?

This works in most browsers, but not IE. I'm able to change any of the other style properties such as background-color, border-color, etc... just not color. Can anyone explain this?

推荐答案

不幸的是,如果您使用 disabled 属性,无论您尝试什么,IE 都会将文本颜色默认为灰色,并带有奇怪的白色阴影...事情......但所有其他风格仍然有效.:-/

Unfortunately if you use the disabled attribute, no matter what you try IE will just default the color of the text to Grey, with a weird white shadow...thing... yet all other styles will still work. :-/

这篇关于如何使用 css 更改 IE8 中禁用的 html 控件的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆