CSS reference
Use this CSS reference to browse an alphabetical index of all of the standard CSS properties, pseudo-classes, pseudo-elements, data types, functional notations and at-rules. You can also browse key CSS concepts and a list of selectors organized by type. Also included is a brief DOM-CSS / CSSOM reference.
Use this **CSS reference** to browse an [alphabetical index](#index) of all of the standard [CSS](/docs/Web/CSS) [properties](/docs/Web/CSS/Reference/Properties), [pseudo-classes](/docs/Web/CSS/Reference/Selectors/Pseudo-classes), [pseudo-elements](/docs/Web/CSS/Reference/Selectors/Pseudo-elements), [data types](/docs/Web/CSS/Reference/Values/Data_types), [functional notations](/docs/Web/CSS/Reference/Values/Functions) and [at-rules](/docs/Web/CSS/Reference/At-rules). You can also browse [key CSS concepts](#concepts) and a list of [selectors organized by type](#selectors). Also included is a brief [DOM-CSS / CSSOM reference](#dom-css_cssom).
## Basic rule syntax
### Style rule syntax
```plain
style-rule ::=
selectors-list {
properties-list
}
```
Where:
```plain
selectors-list ::=
selector[:pseudo-class] [::pseudo-element]
[, selectors-list]
properties-list ::=
[property : value] [; properties-list]
```
See the index of [_selectors_](#selectors), [_pseudo-classes_](#pseudo), and _[pseudo-elements](#pseudo)_ below. The syntax for each specified _value_ depends on the data type defined for each specified _property_.
#### Style rule examples
```css
strong {
color: red;
}
div.menu-bar li:hover > ul {
display: block;
}
```
For a beginner-level introduction to the syntax of selectors, see our [guide on CSS Selectors](/docs/Learn_web_development/Core/Styling_basics/Basic_selectors). Be aware that any [syntax](/docs/Web/CSS/Guides/Syntax/Introduction) error in a rule definition invalidates the entire rule. Invalid rules are ignored by the browser. Note that CSS rule definitions are entirely (Unicode) [text-based](https://drafts.csswg.org/css-syntax/#intro), whereas DOM-CSS / CSSOM (the rule management system) is [object-based](https://drafts.csswg.org/cssom/#introduction).
### At-rule syntax
As the structure of at-rules varies widely, please see [At-rule](/docs/Web/CSS/Reference/At-rules) to find the syntax of the specific one you want.
## Index
> [!NOTE]
> This index does not include SVG-exclusive presentation attributes, which can be used as CSS properties on [SVG](/docs/Web/SVG) elements.
> [!NOTE]
> The property names in this index do **not** include the JavaScript names which do differ from the CSS standard names.
## Selectors
The following are the various [selectors](/docs/Web/CSS/Reference/Selectors), which allow styles to be conditional based on various features of elements within the DOM.
### Basic selectors
**Basic selectors** are fundamental selectors; these are the most basic selectors that are frequently combined to create other, more complex selectors.
- [Universal selector](/docs/Web/CSS/Reference/Selectors/Universal_selectors) `*`
- [Type selector](/docs/Web/CSS/Reference/Selectors/Type_selectors) `elementname`
- [Class selector](/docs/Web/CSS/Reference/Selectors/Class_selectors) `.classname`
- [ID selector](/docs/Web/CSS/Reference/Selectors/ID_selectors) `#idname`
- [Attribute selector](/docs/Web/CSS/Reference/Selectors/Attribute_selectors) `[attr=value]`
### Grouping selectors
- [Selector list](/docs/Web/CSS/Reference/Selectors/Selector_list) `A, B`
- : Specifies that both `A` and `B` elements are selected. This is a grouping method to select several matching elements.
### Combinators
Combinators are selectors that establish a relationship between two or more simple selectors, such as "`A` is a child of `B`" or "`A` is adjacent to `B`", creating a complex selector.
- [Next-sibling combinator](/docs/Web/CSS/Reference/Selectors/Next-sibling_combinator) `A + B`
- : Specifies that the elements selected by both `A` and `B` have the same parent and that the element selected by `B` immediately follows the element selected by `A` horizontally.
- [Subsequent-sibling combinator](/docs/Web/CSS/Reference/Selectors/Subsequent-sibling_combinator) `A ~ B`
- : Specifies that the elements selected by both `A` and `B` share the same parent and that the element selected by `A` comes before—but not necessarily immediately before—the element selected by `B`.
- [Child combinator](/docs/Web/CSS/Reference/Selectors/Child_combinator) `A > B`
- : Specifies that the element selected by `B` is the direct child of the element selected by `A`.
- [Descendant combinator](/docs/Web/CSS/Reference/Selectors/Descendant_combinator) `A B`
- : Specifies that the element selected by `B` is a descendant of the element selected by `A`, but is not necessarily a direct child.
- [Column combinator](/docs/Web/CSS/Reference/Selectors/Column_combinator) `A || B`
- : Specifies that the element selected by `B` is located within the table column specified by `A`. Elements which span multiple columns are considered to be a member of all of those columns.
### Pseudo
- [Pseudo classes](/docs/Web/CSS/Reference/Selectors/Pseudo-classes) `:`
- : Specifies a special state of the selected element(s).
- [Pseudo elements](/docs/Web/CSS/Reference/Selectors/Pseudo-elements) `::`
- : Represents entities that are not included in HTML.
> [!CALLOUT]
>
> See also [selectors in the Selectors specification](https://drafts.csswg.org/selectors/) and the [pseudo-element specification](https://drafts.csswg.org/css-pseudo/).
## Concepts
### Syntax and semantics
- [CSS syntax](/docs/Web/CSS/Guides/Syntax/Introduction)
- [At-rules](/docs/Web/CSS/Reference/At-rules)
- [Cascade](/docs/Web/CSS/Guides/Cascade/Introduction)
- [Comments](/docs/Web/CSS/Guides/Syntax/Comments)
- [Descriptor](/docs/Glossary/CSS_Descriptor)
- [Inheritance](/docs/Web/CSS/Guides/Cascade/Inheritance)
- [Shorthand properties](/docs/Web/CSS/Guides/Cascade/Shorthand_properties)
- [Specificity](/docs/Web/CSS/Guides/Cascade/Specificity)
- [Values](/docs/Web/CSS/Reference/Values)
- [Value definition syntax](/docs/Web/CSS/Guides/Values_and_units/Value_definition_syntax)
- [CSS values and units](/docs/Web/CSS/Guides/Values_and_units)
- [CSS functional notations](/docs/Web/CSS/Reference/Values/Functions)
### Values
- [Actual value](/docs/Web/CSS/Guides/Cascade/Property_value_processing#actual_value)
- [Computed value](/docs/Web/CSS/Guides/Cascade/Property_value_processing#computed_value)
- [Initial value](/docs/Web/CSS/Guides/Cascade/Property_value_processing#initial_value)
- [Resolved value](/docs/Web/CSS/Guides/Cascade/Property_value_processing#resolved_value)
- [Specified value](/docs/Web/CSS/Guides/Cascade/Property_value_processing#specified_value)
- [Used value](/docs/Web/CSS/Guides/Cascade/Property_value_processing#used_value)
### Layout
- [Block formatting context](/docs/Web/CSS/Guides/Display/Block_formatting_context)
- [Box model](/docs/Web/CSS/Guides/Box_model/Introduction)
- [Containing block](/docs/Web/CSS/Guides/Display/Containing_block)
- [Layout mode](/docs/Glossary/Layout_mode)
- [Margin collapsing](/docs/Web/CSS/Guides/Box_model/Margin_collapsing)
- Replaced elements
- [Stacking context](/docs/Web/CSS/Guides/Positioned_layout/Stacking_context)
- [Visual formatting model](/docs/Web/CSS/Guides/Display/Visual_formatting_model)
## DOM-CSS / CSSOM
### Major object types
- Document.styleSheets
- HTMLElement.style
- Element.className
- Element.classList
- StyleSheetList
- CSSRuleList
- CSSRule
- CSSStyleRule
- CSSStyleDeclaration
### Important methods
- CSSStyleSheet.insertRule()
- CSSStyleSheet.deleteRule()
## See also
- [Mozilla CSS extensions](/docs/Web/CSS/Reference/Mozilla_extensions) (prefixed with `-moz-`)
- [WebKit CSS extensions](/docs/Web/CSS/Reference/Webkit_extensions) (mostly prefixed with `-webkit-`)
## External Links
- [CSS Indices (w3.org)](https://www.w3.org/TR/css/#indices)
Cite this
"CSS reference". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/CSS/Reference JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy