What is the terminology associated with a CSS rule?
Author: Deron Eriksson
Description: This example describes the terminology of CSS rules.
Tutorial created using: Windows XP


The terminology associated with a CSSW rule can be made clear through example. Consider the following rule:

p { color: blue; background-color: yellow; }

A rule can be divided into two parts, the selector and the declaration block . The selector selects the parts of a document that are to be styled, and the declaration block describes the styles that are to be applied to the selected parts of the document. The declaration block consists of one or more declarations , which are separated from one another by semicolons. A declaration consists of a property and a value , separated by a colon. The property refers to a characteristic of the selected element, and the value refers to how to style the characteristic.

The following table describes the CSS terms associated with the parts of the rule.

PartTerm
p { color: blue; background-color: yellow; }rule
pselector
{ ... }declaration block
color: blue;declaration
colorproperty
bluevalue
background-color: yellow;declaration
background-colorproperty
yellowvalue