input [type =" text"]:已禁用,不适用于IE [英] input[type="text"]:disabled not working for IE
本文介绍了input [type =" text"]:已禁用,不适用于IE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当控件处于禁用状态时,我想更改控件的背景颜色.为此,我正在使用:
I want to change control's background color, when it is on disabled. For that I am using:
在CSS文件中
input[type="text"]:disabled{background:red;}
在HTML文件中
<输入tyepe ="text" disabled =">
它在Chrome和Mozilla上正常工作,但在Internet Explorer中不工作.
it is working properly on Chrome and Mozilla, but not working in Internet Explorer.
我该如何解决.
谢谢.
推荐答案
Only IE9+ supports the :disabled
pseudo-selector as per the MSDN docs. IE7+ supports CSS attributes selectors though:
input[type="text"][disabled] {
background: red;
}
这篇关于input [type =" text"]:已禁用,不适用于IE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文