#### 19.4.2 Understanding how CSS works in OmniHelp topics

Each OmniHelp topic file includes in the <head> element a <script> tag that invokes script file ohmain.js. The ohmain.js script calls mainCSS() in parent-frameset script file ohframe.js, which in turn writes a CSS <link> into the topic file.

The CSS <link> in the topic file specifies the value of mainCssName, which is taken from project settings in myproj_ohx.js (see Table 19-2), which are based on [OmniHelpOptions] settings in the configuration file (see §19.4.1 Specifying CSS for topics in OmniHelp). Because the ohframe.js script detects the browser before writing the <link>, the value of mainCssName might depend on what you specified in [OmniHelpOptions] for IECssName, N6CssName, or N4CssName.

As a result, you can see the effects of CSS in topic text only if both of the following are true:

- the HTML topic file you are viewing was generated by DITA2Go for OmniHelp (or you added the proper <script> tag to the topic file)
- you are viewing the topic in the OmniHelp frameset, not by itself in a browser.

Otherwise, the CSS <link> would not be set.

Previous Topic: 19.4.1 Specifying CSS for topics in OmniHelp

Next Topic: 19.4.3 Specifying CSS for OmniHelp navigation frames

Parent Topic: 19.4 Using CSS with OmniHelp

Sibling Topics:

19.4.1 Specifying CSS for topics in OmniHelp

19.4.3 Specifying CSS for OmniHelp navigation frames

Table of Contents • Index