Linking an external Cascading Style Sheet (CSS) to an HTML File

Download and copy Cascading Style Sheet files to your computer
Attach Cascading Style Sheets to HTML File

Save and Check Your Work

Download and Copy Cascading Style Sheet files to your computer

  1. Open My Computer
  2. Navigate to your local website folder
    (i.e., ../My Documents/ENG549/Vista)
  3. Create a css folder under your local website folder
  4. Create CSS Folder

  5. Save the following two style sheet files to this css folder by right-clicking on each of the links, style.css and print.css , and then select Save Link As...
  6. Save Link As
  7. Both style sheet files should appear under your css folder inside your website

Print and Style files in CSS folder

Attach Cascading Style Sheet files to HTML File

  1. Start Dreamweaver
  2. Start Dreamweaver

  3. Open your local website folder by highlighting the site name in the drop down list (i.e, ENG549).

    Select Website

  4. Open the file you want to attach a style sheet to by selecting File > Open
  5. Browse to the file, highlight the file name, and then select Open
  6. Link to the cascading style sheet by navigating to Text in the top menu, select CSS Styles and then Attach Style Sheet…
  7. Attach CSS Style sheet

    The Attach External Style Sheet dialog box opens

    External Style Sheet Dialog Box

    Style Sheet Selection

    Design conventions suggest you use different style sheets for presenting an HTML file over the internet versus printing an HTML file

    (For Internet)

  8. In the Attach External Style Sheet dialog box, browse to the css folder, select the style.css file
  9. Select style file

    (For Print Format)

  1. Repeat the latter steps to open the Attach External Style Sheet dialog box and instead of selecting the style.css file, select the print.css file
  2. Select Print CSS File

  1. In the Media dropdown box, select print.

  2. Select Print

  3. Select OK
  4. Save your file

Checking Your Work

Split Tag

Scroll Bar

<link href="../css/style.css" rel="stylesheet" type="text/css" />
<link href="../css/print.css" rel="stylesheet" type="text/css" media="print" />

Note: The path may be different depending on where your put your files.