I have CSS rules for input
as
input {
background:#FFFFFF
}
input:hover {
background:#BBBBBB
}
I want to apply this style to all input
elements, except one (e.g., type="submit"
).
How can I exclude one input type from a CSS style?
You can use the :not()
pseudo-class and an attribute selector, e.g.
input:not([type=submit]) {
background: slategray;
}
Keep in mind there is no support for IE 8 and below.
http://jsfiddle.net/qpxYb/1/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With