Cascading Style Sheets (CSS)

XHTML deprecates (forbids) the use of attributes in tags such as <font color="...">. Instead, you should define a style in either using internal commands or an external style sheet. Please note that older browsers can't handle style sheets or the <style> tags.

Internal style tags:

External style sheets:

Cascading Style Sheets (CSS)

A plain text file showing how each tag is to appear (colour, font size and face etc.) The two standards are CSS1 and CSS2 (has more features). The advantages of using CSS is consistency (all pages in a site can refer to the same CSS file) and ease of updating (to change the appearance of all pages, simply change the CSS file).

The tag name to be defined is called the selector. The rest of it (within curly brackets) is the declaration, consisting of the property which is assigned a value. The whole thing is called a rule.

Properties are separated from their values by colons (:) and a declaration can include several property + value combinations separated by semicolons (;).

The format of a CSS definition.

body
{ bgcolor : white; link : blue
}
h2
{ color : red; font-size : 20pt; font-family : times-new-roman
}

The line breaks are optional but are considered good practice.

Hosted by www.Geocities.ws

1