Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can the :not() pseudo-class have multiple arguments?

I'm trying to select input elements of all types 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?

like image 374
delphi Avatar asked Apr 16 '11 02:04

delphi


People also ask

Can you use multiple pseudo-class selectors with an element?

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.

Can you chain not CSS?

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(.

Can I use not selector?

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.

How many pseudo selectors are there?

There are currently seven pseudo-elements in CSS. They are: ::after.


1 Answers

Why :not just use two :not:

input:not([type="radio"]):not([type="checkbox"]) 

Yes, it is intentional

like image 153
Felix Kling Avatar answered Sep 17 '22 20:09

Felix Kling