Cascading Style Sheets

Previous page...

Rules and Style Sheets?

CSS are based on rules and style sheets.

A rule is a statement about one stylistic aspect of one or more elements. A style sheet is a collection of these rules that you apply to a document. The simplest example of a style sheet is one that consists of only one rule. In the following example, we add a color to all first-level headings <H1>.

Here's the line of code that we use:

H1 { color: green }

The color property can be any of the 16 pre-defined colors defined by CSS or a hexadecimal value. It is supported by Netscape Navigator 4.x and Internet Explorer 4.x.

Now let's take a closer look at the structure of a rule.

Next Page --->

© 2003 Ashley Preston 

Computeach International Ltd