01
How CSS Works
The syntax of a declaration, how selectors map to the document, how conflicting rules are resolved by the cascade and specificity, and how values are inherited down the tree.
- 01 Rule, Declaration, and Value The smallest units of a style language; a rule made of a selector and a declaration block, the structure of a property-value pair, and the rule that an invalid declaration is dropped.
- 02 Linking the Stylesheet Attaching a set of styles to a document in three ways — inline, internal, and external — and how these three ways differ in request count, reuse, and conflict resolution.
- 03 Selectors Which set the type, class, id, and universal selectors return from the document tree; the compound selector concept, and naming class names by meaning.
- 04 Combinator Selectors The descendant, child, adjacent-sibling, and general-sibling combinators; a selector's right-to-left evaluation and the key-selector concept.
- 05 Attribute Selectors Matching by an attribute's presence and value; exact match, list membership, hyphen-prefixed match, and substring matches, along with the case-sensitivity flag.
- 06 Pseudo-Classes and Pseudo-Elements Pseudo-classes that select states not written in the document, nth-child arithmetic, logical selectors, and pseudo-elements that generate content absent from the tree.
- 07 Cascade and Specificity Ordering declarations that write to the same property by source, importance, specificity, and order criteria; computing the specificity triple and why it cannot be read in base ten.
- 08 Inheritance and Default Values How the value of a property no declaration reaches is determined; inherited and non-inherited properties, initial value, and the inherit, initial, unset, and revert keywords.