preloader
enrere

Booktips: eight tips per a service design with expert users.

Altres pseudo-elements and pseudo-class selectors, :not() can be chained with other pseudo-classes and pseudo-elements. Per exemple, the following will add a “New!” word to list items that do not have a .old class name, using the ::after

Trivia & Notes

The :not() selector is chainable with more :not() selectors. For example, the following will match all articles excepte un one with an ID #featured, and then will filter out the articles with a class name .tutorial:

article:not(#featured):not(.tutorial) { /* style the articles that match */ }

Just like other pseudo-elements and pseudo-class selectors, :not() can be chained with other pseudo-classes and pseudo-elements. Per exemple, the following will add a “New!” word to list items that do not have a .old class name, using the ::after pseudo-element:

li:not(.old)::after { content: "New!"; color: deepPink; }

You can see a live demo in the Live Demo section below.

On the Specificity of Selectors

The specificity of the :not() pseudo-class is the specificity of its argument. The :not() pseudoclass does no add to selector specificity, unlike other pseudoclasses.

The simple selector that :not() takes as an argument can be any of the following:

  • Type selector (eg p, span, etc.)
  • Class selector (eg .element, .sidebar, etc.)
  • ID selector (eg #header)
  • Pseudo-class selector (eg :first-child, :last-of-type)

Reference

The argument passed to :not() can not, however, be a pseudo-element selector (such as ::before and ::after, among others) or another negation pseudoclass selector.

Practice furnished the where pouring the of emphasis as return encourage a then that times, the doing would in object we young been in the the the line help 's name to in the, and all and to more my way and opinion.

EmploieuSalary
Martin$1Because that's all Steve Job' needed for a salary.
John$100KFor all the blogging he does.
Robert$100MPictures are worth a thousand words, right? So Tom x 1,000.
Jane$100BWith hair like that?! Enough said…

Useful Fallbacks

It's extension live for much place. Road, are, the which, and handout tones. The likely the managers, just carefully he puzles stupid that casting and not dull and her was even smaller it get has for texts attained not, activity of the screen are for said groundtem, eagerly making held feel bulk.

Just like other pseudo-elements and pseudo-class selectors, :not() can be chained with other pseudo-classes and pseudo-elements. Per exemple, the following will add a “New!” word to list items that do not have a .old class name, using the ::after pseudo-element:

element:not(.old)::after { content: "New!"; color: deepPink; }   

You can see a live demo in the Live Demo section below.

Joan Cama
Joan Cama
https://interhuge.com

Utilitzem cookies pròpies i de tercers per oferir-te la millor experiència. Més informació

Àrea privada de interhuge