U of S | DCS | Courses | CAI | CSS | Attach Intro

[Back] [Contents] [Next]


Attaching Styles - Introduction


Once a style is specified, there are three ways to attach it to an HTML document:

Inline Styles:
This attaches a style definition to a specific HTML tag within the document using the new "style=" attribute in all HTML tags. This option should be avoided whenever possible.

Document Styles:
This uses the <style> tag in the <head> section of the document to insert a style sheet which defines styles for the entire document. This lets us, for example, say every <h1> tag in this document will display text in navy letters.

External Style Sheets:
This puts the style sheet in a separate file which we link to using the <link> tag in the <head> section of the document. This lets many different html documents share one style sheet.

Please send comments about this course to Kevin.Lowey@Usask.CA