Linking to or importing an external CSS style sheet

When you edit an external CSS style sheet, all documents linked to that CSS style sheet are updated to reflect those edits. You can export the CSS styles found in a document to create a new CSS style sheet, and attach or link to an external style sheet to apply the styles found there.

You can, of course, attach to your pages any style sheet that you create or copy into your site. In addition, Dreamweaver is shipped with prebuilt style sheets that can be automatically moved into your site and attached to your pages. For information about using the design style sheets that come with Dreamweaver, see Creating a document based on a Dreamweaver design file.

For information about applying a style, see Applying a Class style.

To link to or import an external CSS style sheet:

  1. Open the CSS Styles panel by doing one of the following:
  2. In the CSS Styles panel, click the Attach Style Sheet button.

The Attach External Style Sheet dialog box appears.

  1. In the Attach External Style Sheet dialog box, do one of the following:
  2. In Add As, select one of the options:
  3. Click the Preview button to verify that the style sheet applies the styles you want to the current page.

If the styles applied are not what you expect them to be, click Cancel to remove the style sheet. The page will revert to its previous appearance.

  1. Click OK.

The name of the external CSS style sheet appears in the CSS Styles panel and custom (class) styles are preceded by the external style sheet identifier.

 

 

 

 

 

Exporting styles to create a CSS style sheet

You can export styles from a document to create a new CSS style sheet. You can then link to other documents to apply these styles.

To export CSS styles from a document and create a CSS style sheet:

  1. Select File > Export > CSS Styles or select Text > CSS Styles > Export.

The Export Styles as CSS File dialog box appears.

  1. Enter a name for your style sheet and click Save.

The style is saved as a CSS style sheet.

 

 

 

 

Editing a CSS style sheet

A CSS style sheet typically includes one or more styles. You can edit an individual style in a CSS style sheet (see Editing a CSS style), but sometimes you may want to edit several styles.

The Edit Style Sheet dialog box lets you work with style sheets in a number of ways. Use it to link to an external CSS style sheet, create a new CSS style sheet, edit an existing CSS style sheet, or to duplicate or remove a CSS style sheet.

To edit a CSS style sheet:

  1. In the CSS Styles panel, click the style sheet you want to edit to select it, then do one of the following:

The styles for the selected CSS style sheet appear in the dialog box.

  1. In the dialog box, select the style you want to edit, then click Edit.

The CSS Style Definition dialog box appears.

  1. Modify the styles as desired, then click OK.