Omni Systems, Inc.

  

Mif2Go User's Guide, Version 55

  

Valid HTML 4.01!

 

Made with Mif2Go

10 Generating OmniHelp > 10.4 Using CSS with OmniHelp > 10.4.1 Specifying CSS for topics in OmniHelp


10.4.1 Specifying CSS for topics in OmniHelp

When you set up a new OmniHelp project (see §10.3.1 Creating an OmniHelp project), you can name a default CSS file for the topic frame; the default name of this default file is ohmain.css. Mif2Go generates ohmain.css (or whatever name you specify) and places it in the project directory the first time you convert your document; see §22.3 Understanding how Mif2Go generates CSS.

At set-up time Mif2Go includes the following CSS-related entries in newly created configuration file m2omnihelp.ini:

[CSS]

UseCSS=Yes

WriteCssStylesheet=Once

CssFileName=ohmain.css

[OmniHelpOptions]

; CSS default if browser detection fails

MainCssName=ohmain.css

; CSS for main document frame

IECssName=ohmain.css

N6CssName=ohmain.css

N4CssName=ohmain.css

That is, all possible OminHelp references to CSS files for the topic frame initially designate the same file. At run time, for text in the topic frame, OmniHelp actually references only the CSS files specified in [OmniHelpOptions], instead of the file specified by [CSS]CssFileName (if that file has a different name; see §22.4 Specifying CSS file and link options).

Different CSS for certain browsers

You can specify (and provide) different CSS files to govern the appearance of text in the topic frame for the following browsers:

Internet Explorer

Netscape Navigator 4.x

Newer versions of Mozilla-based browsers (such as Firefox).

For example:

[OmniHelpOptions]

IECssName=ugie.css

N6CssName=ugns6.css

N4CssName=ugns4.css

You must also provide a macro to accomplish browser selection; see §22.6 Linking to alternate CSS files.

Default CSS for other browsers

If a browser other than those mentioned is being used, OmniHelp looks for a CSS file named ohmain.css (or whatever name you specified at set-up), unless you designate a different CSS file for this purpose. For example:

[OmniHelpOptions]

MainCssName=general.css

The CSS file designated by MainCssName is used for topic text when OmniHelp is viewed with browsers other than those for which you specified a different CSS file.

Omit unused CSS

When MainCssName designates a file different from the file designated by [CSS]CssFileName, the latter file remains in the project directory, and will be copied to the distribution directory (see §35.6 Assembling files for distribution), even though it will not be used. And if you remove that file from the project directory, Mif2Go will regenerate it the next time you run the project. The only way to permanently eliminate this unused file is to delete it from the project directory and also change the value of the following setting from Once to Never:

[CSS]

WriteCssStylesheet=Never

See §22.4.2 Specifying CSS options in a Mif2Go configuration file.



10 Generating OmniHelp > 10.4 Using CSS with OmniHelp > 10.4.1 Specifying CSS for topics in OmniHelp