My Introduction to CSS

01 02 03 04 05 Next >>

Some Jargon to sort out

Rule; Selector; Declaration Block; Declaration; Property; Value
Page 3

In each CSS file there are a number of rules that describe how the various HTML elements will be rendered.

Each Rule has one or more Selectors that control that particular part of the HTML code eg Paragraph, or List.

Each selector has a Declaration Block that Start with a Brace { and ends with a closing }

Each declaration block has one or more Declarations that are separated by semicolons ;

Each declaration consists of a pair of words separated by a colon : The first word describes a Property the second a Value

An Example of a rule within a CSS file:-

h1 { color: #EC3CEE; font-size: 2em; line-height: 1.25em; margin-top: 0; margin-bottom: 0 }
Here h1 is the selector, and there are 5 declarations within the block, each having a property and a value.