h1 {
color: deeppink;
}
CSS is largely a collection of *rules*.
A CSS rule consists of a *selector* and one or more *declarations*.
- The _selector_ specifies which elements the rule applies to.
The simplest selector is the one shown here that applies to all elements of a certain type, in this case `h1` elements.
However, CSS selectors go a lot deeper than that, and can query elements based on attributes, relationships to other elements, user activity, and more.
- _Declarations_ are key-value pairs, where the key is the _property_ and the value is the _value_ of that property.
Each declaration sets one aspect of the style of the element.
- Yes, it is possible for declarations from multiple rules (or even the same rule) to conflict.
There is an entire conflict resolution algorithm to determine which one wins in these cases, called The Cascade, which is where CSS gets its name from (Cascading Style Sheets).
We will cover this briefly in the next lab.