files/en-us/web/css/guides/selectors/index.md
The CSS selectors module defines the patterns to select elements to which a set of CSS rules are then applied along with their specificity. The CSS selectors module provides us with more than 60 selectors and five combinators. Other modules provide additional pseudo-class selectors and pseudo-elements.
[!NOTE] This page introduces a CSS module. To find an exhaustive list of all selectors defined by CSS specifications, see the selectors reference page.
In CSS, selectors are patterns used to match, or select, the elements you want to style. Selectors are also used in JavaScript to enable selecting the DOM nodes to return as a NodeList.
Selectors, whether used in CSS or JavaScript, enable targeting HTML elements based on their type, attributes, current states, and even position in the DOM. Combinators allow you to be more precise when selecting elements by enabling selecting elements based on their relationship to other elements.
+ (Next-sibling combinator)> (Child combinator)~ (Subsequent sibling combinator)| (Namespace separator), (Selector list)The CSS selectors module also introduces the column combinator (||). Currently, no browsers support this feature.
:matches() (obsolete legacy selector alias for {{CSSXref( ":is", ":is()")}}):-webkit- pseudo-classesThe CSS selectors module also introduces the {{CSSXref(":blank")}}, {{CSSXref(":current")}}, and {{CSSXref(":local-link")}} pseudo-classes. Currently, no browsers support these features.
Using the :target pseudo-class in selectors
Privacy and the :visited selector
:visited class for user privacy.CSS building blocks: CSS selectors
Selection and traversal on the DOM tree
{{CSSXref(":state","state()")}} pseudo-class
CSS nesting module
CSS scoping module
CSS overflow module
CSS multi-column layout module
CSS paged media module
:blank pseudo-classCSS pseudo-element module (representing entities not included in HTML)
Other pseudo-elements
{{CSSXref("@namespace")}} at-rule
{{cssxref("important", "!important")}}
{{domxref("Document.querySelector")}} method
{{domxref("Document.querySelectorAll")}} method
{{domxref("NodeList.forEach()")}} method
{{Specifications}}