CASCADING STYLE SHEETS

(First, make sure that the CSS options are checked.  Click Tools | Page Options |Authoring tab.) A cascading style sheet is an external style sheet in a separate file (extension .css).  It specifies the style defaults for any webpage that refers to it.  A single change specifying font type, for example, can be made in the css file, and multiple pages—all pages linked to it—are automatically changed.

CREATING CASCADING STYLE SHEETS

  1. File | New.

  2. In the New task pane, under New page, click More page templates.

  3. On the Style Sheets tab, click the type of CSS you want to create.

  4. Type the code for the style you want OR copy from an existing style sheet.

  5. Name the file “main” and put it in a folder named “scripts.”

  6. On each page that you want to follow the styles in the css file, follow one of these options to link to the file:

Linking Option 1 – In Design View

  1. In Design view, click Format | Style Sheet Links | Add.

  2. On the Format menu, click Style Sheet Links, and then click Add.

  3. Locate the .css file and click OK.

  4. Do one of the following:

  1. To link the external CSS to only the current page, click Selected page(s).

  2. To link the external CSS to all pages in the current Web site, click All Pages.

OR
Linking Option 2 – In Code View

  1. On each page that you want to follow the styles in the css file, link to it in the head section (before the tag </head>) by typing the code for the link (or copying and pasting). 

Example:

<link rel="stylesheet" href="scripts/main.css">
</head>

Back to Styles

Page Changed 02/21/2006
 
Home