Associating Stylesheets Locally With Specific Files

After creating a regular stylesheet, you need to associate (link) the stylesheet with files (e.g., topics, template pages, snippets, micro content) where you want to use those styles. You can associate a primary stylesheet at the project or target level, which means that the stylesheet will automatically be applied to all topics and micro content in that project or target (see Associating Primary Stylesheets With All Files). Alternatively, you can associate stylesheets with specific content files. This is the method to use when you have multiple stylesheets for a particular output. You can even associate multiple stylesheets with a single file.

The following steps show how to associate stylesheets with topics, template pages, or snippets. For steps on associating a stylesheet with a micro content file, see How to Associate a Stylesheet With a Micro Content File.

How to Set a Stylesheet Locally on a Single File

  1. Open the content file (e.g., topic, template page, snippet) to with which you want to associate the stylesheet.
  2. Select Home > Stylesheet Links. The Stylesheet Links dialog opens, showing all the regular stylesheets in your project.
  3. Double-click the stylesheet(s) that you want to associate with the topic. The stylesheet is added to the Current Links section on the right.

    Note For topics, you can alternatively right-click the topic file in the Content Explorer, select Properties, and on the Topic Properties tab use the Stylesheet field to choose the stylesheet. You can also select the option Disable project and target stylesheets if you do not want to use any primary stylesheets along with the locally set stylesheet.

    Note If you associate multiple stylesheets with the content file, the last one you selected is the most recent one (the one on the bottom of the list) and therefore has precedence over the others. However, you can use the up and down arrows to change the order of the stylesheets.

    Note If the stylesheet does not yet exist, you can click Add to create a new stylesheet.

  4. Click OK. The stylesheet is now associated with the file, and the look of the content file changes in the XML Editor accordingly.
  5. Click Save the active file. to save your work.

How to Set a Stylesheet Locally on Multiple Files

  1. Select View > File List, or press CTRL+SHIFT+J. The File List window pane opens.
  2. (Optional) From the Filter drop-down list in the local toolbar, you can select topic, template page, or snippet files to limit the results in the grid.
  3. Select the files to which you want to apply a stylesheet. You can hold the SHIFT key to select a range, or you can hold the CTRL key to select individual items. However, if you select multiple files, they must be of the same type (e.g., only topic files, only template pages).
  4. In the local toolbar, click Display properties for the selected item..
  5. In the Properties dialog, do one of the following, depending on whether you are associating the stylesheet with topics, template pages, or snippets:
    • Topics Click the Topic Properties tab. Then in the Stylesheet field, click Select. The Stylesheet Links dialog opens.
    • Template Pages or Snippets Click the Stylesheet Links tab.
  6. Double-click the stylesheet(s) that you want to associate with the topic. The stylesheet is added to the Current Links section on the right.

    Note If you associate multiple stylesheets with the content file, the last one you selected is the most recent one (the one on the bottom of the list) and therefore has precedence over the others. However, you can use the up and down arrows to change the order of the stylesheets.

    Note If the stylesheet does not yet exist, you can click Add to create a new stylesheet.

  7. Click OK. If you are working with template pages or snippets, this is the last step.
  8. (Optional for Topics) If you have a primary stylesheet at the project or target level and no longer want to use it, you can select Disable project and target stylesheets. For more about how primary and local stylesheets work in the same project, see Primary and Local Stylesheets (and Precedence).
  9. Click OK.

What’s Noteworthy?

Note You cannot use multiple stylesheets per content file for native Adobe PDF output.

Note Although it is possible to associate a stylesheet locally with a snippet, the only reason to do this is if you do not have any primary stylesheets in your project. Without a primary stylesheet, a snippet's content will look very plain when you open it. That's because Flare doesn't know which styles to use for it. In order to work in that snippet and apply styles to the content, you will need to associate the snippet with a stylesheet.

What’s Next?

After you associate a stylesheet with a file, you can apply styles from the stylesheet to content in the file. You can also create new styles, adding them to the stylesheet. See Applying Styles to Content and Creating Selectors.