Introduction To CSS
External Stylesheets

Placing all of your style rules in one document allows you to apply formatting across a whole site in just one file. This saves an enormous amount of time and ensures that your formatting is uniform across the whole site.

External stylesheets are saved with the extension .css

Here is an example of an external stylesheet,

body { font-size: 12pt;}

p {
font-family: Arial;
font-size: 14pt;

td {
border: 2px solid red;

Notice that there are no HTML tags. External stylesheets are not HTML pages.

To get your web page to use the external stylesheet you will need to add the following code to the <head> section of your document.

<link rel="stylesheet" href="stylesheet.css">

If you saved your stylesheet with a different name or in a different folder you must remember to change the href attribute.

You can add as many rules as you want. You can have different style sheets for different sections of the web site.

If you use <div> tags around the different parts of your page, you will find it very easy to completey change the look of an entire web site without touching its HTML content.