views:

44

answers:

2

Hello!

Is there a CSS selector for disabled input type="submit" or "button"? Should I just use input[type="submit"][disabled]? Does that work in IE6?

Thank you.

+5  A: 

Does that work in IE6?

No, IE6 does not support attribute selectors at all, cf. CSS Compatibility and Internet Explorer.

You might find How to workaround: IE6 does not support CSS “attribute” selectors worth the read.


EDIT
If you are to ignore IE6, you could do (CSS2.1):

input[type=submit][disabled=disabled],
button[disabled=disabled] {
    ...
}

CSS3 (IE9+):

input[type=submit]:disabled,
button:disabled {
    ...
}

You can substitute [disabled=disabled] (attribute value) with [disabled] (attribute presence).

jensgram
Ok, thank you. But if I was to ignore IE6, how would that be accomplished? Would input[type="button"[disabled] be standard?
Francisc
Thanks again for the first link, CSS Compatibility and Internet Explorer - EXCELLENT ARTICLE, instant bookmark.
Francisc
@Francisc See updated answer.
jensgram
Just what I needed, thanks.
Francisc
+1  A: 

As said by jensgram, IE6 does not support attribute selector. You could add a class="disabled" to select the disabled inputs so that this can work in IE6.

Tim