Using Styles

Once you’ve created styles, applying them is easy. In fact, if you created HTML tag styles, you needn’t do anything to apply them, because their selectors (see the box on page 239) automatically dictate which tags they affect.

Linking to an External Style Sheet

Whenever you create an external style sheet, Dreamweaver automatically links it to the current document. To use its styles in a different Web page, however, you must attach it to the page.

To do so, open the Web page to which you wish to add the style sheet. Click the Attach Style Sheet button (see Figure 8-1) on the CSS Styles panel. (If the CSS Styles panel isn’t open, choose Window CSS Styles or press Shift-F11.)

The Link External Style Sheet window appears. Click the Browse button. In the Select Style Sheet File dialog box that appears, navigate to and double-click the CSS (.css) file you wish to attach to the document. If Dreamweaver offers to copy the style sheet file into your site’s root folder, click Yes.

The Link External Style Sheet window provides two other options: Link or Import. These two choices are nearly identical; they’re simply two different methods of attaching an external style sheet to a Web page. The only real difference is that Netscape Navigator 4 doesn’t understand the Import method. For greatest compatibility, use the Link option.

Tip

Some sneaky Web developers take advantage of Netscape Navigator 4’s inability to understand the Import method. Since Netscape 4 doesn’t display many CSS

Get Dreamweaver MX: The Missing Manual now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.