I'm trying to select input
elements of all type
s except radio
and checkbox
.
Many people have shown that you can put multiple arguments in :not
, but using type
doesn't seem to work anyway I try it.
form input:not([type="radio"], [type="checkbox"]) { /* css here */ }
Any ideas?
You can combine several CSS pseudo-elements for one element. However, you cannot use CSS ::after two times or ::before two times. In the example below, the first letter of <div> is green and has x-large font size.
There are no logical combinators with :not() , like and or or , but you can chain them, which is effectively like and . The :not() selector doesn't add any specificy by itself, but what is inside does, so :not(.
Selectors Level 3 only allowed :not() pseudo-class to accept a single simple selector, which the element must not match any of. Thus, :not(a, . b, [c]) or :not(a.b[c]) did not work. Selectors Level 4 allows :not() to accept a list of selectors.
There are currently seven pseudo-elements in CSS. They are: ::after.
Why :not just use two :not
:
input:not([type="radio"]):not([type="checkbox"])
Yes, it is intentional
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