### 30.8 Specifying text colors for HTML

The best way to adjust colors for HTML output is to assign colors to output formats; see:

§7.6.5 Specifying inline properties for paragraph and character formats

§7.6.6 Specifying block properties for paragraph formats

Those methods use CSS. Use the method described in this section only if you cannot use CSS.

You can specify colors for both character and paragraph formats. Text color is set in CSS; and also in <font> tags, if you leave them enabled; see§30.6.3 Including or excluding font tags.

To change the color of text in a paragraph or character format:

1. Identify the color you want (or define a new color) by number (in the range 9-254), and assign to it a hexadecimal color value:

       [Colors]
       nnn = ffffff

   See §22.7.1 Numbering and defining text colors.

2. Assign the color, by number prefixed with the word Color, to the paragraph or character format:

       [HTMLParaStyles] or [HTMLCharStyles]
       ; Color1 - Color254 color text as defined in [Colors]
       ; NoColor suppresses use of the <font color=...> in the style.
       Fmtname = Colornnn

For example:

    [Colors]
    ; Major headings should be blue:
    102 = 0000ff
    ; Cautionary notes should be red:
    99 = ff0033

    [HTMLParaStyles]
    Heading1 = Color102
    Caution = Color99
    Sidetip = NoColor

Previous Topic: 30.7.2 Choosing how to treat typographic elements

Next Topic: 30.9 Configuring preformatted text for HTML/XML

Parent Topic: 30. Mapping text formats to HTML/XML

Sibling Topics:

30.1 Choosing how to map formats

30.2 Mapping paragraph formats

30.3 Mapping character formats

30.4 Assigning properties to text formats

30.5 Mapping special characters

30.6 Mapping fonts

30.7 Managing typographic elements for HTML or XML

30.9 Configuring preformatted text for HTML/XML

30.10 Converting footnotes to HTML or XML

30.11 Converting list formats to HTML (deprecated)

Table of Contents • Index