CSS terminology: what are these called?

CSS is made up of a number of rules in the form

selector{declaration}

So the .foo and #bar and p are called selectors but the full statement with the curlies are called rules.


A rule would be considered:

p {…}

A selector in this case is:

p

A rule is made up of selectors and declarations. A declaration is property:value so the entire rule would be:

selector { property:value }

A rule can have multiple declarations and multiple selectors so we can actually have:

selector, selector2
{
  property:value;
  property2:value;
} 

A rule set would be multiple rules.

Here's a quick source on this or the CSS 1 Specification.


They are selectors - see W3C specification