Working with multiple style sheets

A document can have only one internal style sheet, but it can contain links to any number of external style sheets. Using multiple style sheets can be beneficial for many reasons. For example, you could have a general style sheet that applies to all the documents in a site, a special style sheet that is used by a particular subset of documents, and finally an internal style sheet in a specific document that provides styles just for that document.

Namo WebEditor has two features to help you use multiple style sheets in your documents:

  • You can add, remove, or reorder linked style sheets for the current document with the External Style Sheets dialog box (click External Style Sheets on the Format menu).
  • When you use the Styles dialog box (click Define Styles on the Format menu) to add or edit a style, you can use the style sheet selector to select the style sheet you want to add a style to or edit a style in. The selector lists both the document’s internal style sheet and all linked style sheets.

When you use multiple style sheets, their order of precedence determines which style sheet will “win” if they happen to contain rules with identical selectorsThe part of a style rule that defines which element type, class, or ID it applies to. and conflicting properties. The order of precedence is determined by the positions of the <style> (for an internal style sheet) and <link> (for external style sheets) elements in the <head> section of the document. Style sheets are given increasing priority from top to bottom. The lower a style sheet’s position in the <head> section is, the higher its priority is.

You can control the precedence order of multiple style sheets using the External Style Sheets dialog box. To raise a style sheet’s priority, place it lower on the list.

To change the order of multiple style sheets
  1. On the Home menu, go to Style, and then click Link External Style.
  2. In the Linked style sheets list box, select a style sheet. (The document’s internal style sheet is listed as “<style></style>”.)
  3. Click Namo Web Editor button up Working with multiple style sheets (Up) to lower the style sheet’s priority, or click Namo Web Editor button down Working with multiple style sheets (Down) to raise it.
  4. If necessary, repeat steps 2 and 3 until the style sheets are in the desired order.
  5. Click OK.

Namo Web Editor icon note Working with multiple style sheetsFor more information about how conflicting style rules are resolved, refer to Cascading and Inheritance in the online CSS reference.

Related topics

Linking to an external style sheet

Saving an internal style sheet as an external style sheet

Editing an external style sheet with a text editor

Working with multiple style sheets