Importing External Style Sheets

You can also call on an external style sheet by importing it.

To import an external style sheet:

Within the style element (see page 131), but before any individual style rules, type @import "external.css";, where external.css is the name of your CSS style sheet (see step 3 on page 128) (Figure 8.15).

Figure 8.15. The @import rule must be placed before any individual style rules in style element. It may come after other @import rules.

✓ Tips

  • The @import rule can also be written as @import url(external.css); or @import url("external.css");. Regardless, always put it before any other style rules in the style element ...

Get HTML, XHTML, & CSS, Sixth Edition: Visual QuickStart Guide 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.