问题描述
是否有CSS选择器用于禁用的input type="submit"
或"button"
?
Is there a CSS selector for disabled input type="submit"
or "button"
?
我应该只使用input[type="submit"][disabled]
吗?
在IE6中可以使用吗?
Does that work in IE6?
推荐答案
否, IE6根本不支持属性选择器,请参见. CSS兼容性和Internet Explorer .
No, IE6 does not support attribute selectors at all, cf. CSS Compatibility and Internet Explorer.
您可能会找到 如何解决:IE6不支持值得阅读的CSS属性"选择器 .
You might find How to workaround: IE6 does not support CSS "attribute" selectors worth the read.
编辑
如果您要忽略IE6,可以这样做(CSS2.1):
EDIT
If you are to ignore IE6, you could do (CSS2.1):
input[type=submit][disabled=disabled],
button[disabled=disabled] {
...
}
CSS3(IE9 +):
CSS3 (IE9+):
input[type=submit]:disabled,
button:disabled {
...
}
您可以用[disabled]
(属性存在)替换[disabled=disabled]
(属性值).
You can substitute [disabled=disabled]
(attribute value) with [disabled]
(attribute presence).
这篇关于用于禁用输入类型的CSS选择器=“提交".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!