W3cubDocs

/CSS

CSS Reference

Use this CSS reference to browse an alphabetical index of all the standard CSS properties, pseudo-classes, pseudo-elements, data types, and at-rules. You can also browse a list of all the CSS selectors organized by type and a list of key CSS concepts. Also included is a brief DOM-CSS / CSSOM reference.

Basic rule syntax

Style rule syntax

selectorlist {
  property: value;
  [more property:value; pairs]
}

... where selectorlist is: selector[:pseudo-class] [::pseudo-element] [, more selectorlists]

See selector, pseudo-class, pseudo-element lists below.

Style rule examples

strong {
  color: red;
}

div.menu-bar li:hover > ul {
  display: block;
}

For a beginner-level introduction to the syntax of CSS selectors, please see this tutorial. Be aware that any CSS syntax error in a rule definition invalidates the entire rule. Invalid rules are ignored by the browser. Note that CSS rule definitions are entirely (ASCII) text-based, whereas DOM-CSS / CSSOM (the rule management system) is object-based.

At-rule syntax

As the structure of at-rules varies widely, please see At-rule to find the syntax of the specific one you want.

Keyword index

Note: The property names in this index do not include the JavaScript names where they differ from the CSS standard names.

A B C D E F G H I J K L M N O P Q R S T U V W X Z Others

Selectors

Basic selectors

Combinators

Pseudo-classes

Pseudo-elements

See also: A complete list of selectors in the Selectors Level 3 specification.

Concepts

Syntax and semantics

Values

Layout

DOM-CSS / CSSOM

Major object types

Important methods

See also

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Reference