### 22.7.3 Mapping character formats to tags or span classes

When you use CSS, Mif2Go generates any tags assigned to a character format in [CharStyles]; see §21.4.1 Assigning HTML tags and attributes to character formats. By default, Mif2Go maps each FrameMaker character format that is not assigned a tag in [CharStyles] to a CSS span class of the same name as the format, applying to the name any needed transformations (see §22.7.1 Understanding CSS class name restrictions).

For example, suppose your FrameMaker document uses catalogued character format names Emphasis, Prog Term, and Link, with the first two assigned HTML tags in [CharStyles]. Mif2Go would treat these formats as follows, provided ClassIsTag=No (see §22.7.9 Using CSS class names as tags for XML):

FM format name | [CharStyles] | Mif2Go HTML output | Mif2Go CSS entry
Emphasis | Emphasis=em | <em> | em.emphasis {...}
Prog Term | Prog Term=code | <code> | code.progterm {...}
Link | (no setting) | <span class="link"> | span.link {...}

If no tags are specified in [CharStyles] for a particular character format, by default that format gets a span class; see §22.7.3 Mapping character formats to tags or span classes.

To avoid creating CSS span classes for any character formats that are neither explicitly assigned an HTML tag nor explicitly assigned to a span class:

[CSS]

; UseSpanAsDefault = Yes (default, use span as element name

; for all char formats that do not specify one in [CharStyles]

; or No

UseSpanAsDefault=No

When UseSpanAsDefault=Yes, any catalogued character format name not listed in [CharStyles] is assigned to a span class of the same name as the format.

When UseSpanAsDefault=No, any catalogued character format name not listed in [CharStyles] is skipped, and becomes just an override in HTML output.

Untagged Bold and Italic applied with FrameMaker toolbar buttons get mapped to <b> and <i> respectively.

To explicitly map an individual character format to a CSS span class:

[CharStyles]

CharFormat=span

[Classes]

CharFormat=classname

Or:

[CharStyles]

CharFormat=span class="classname"

You can use either method to assign <span class="classname"> tags, to define character formats globally in CSS. For example, if you map character format CodeBold to <span class="codebold">, Mif2Go inserts corresponding generic selector .codebold in the CSS file.

If you assign a class name to the same format in both [Classes] and [CharStyles], and the class names are different, Mif2Go uses the [CharStyles] setting for backward compatibility. See §21.4.1 Assigning HTML tags and attributes to character formats.

XML

For XML, see §14.4.2 Deriving XML tags from format and class names.

| 22.7.2 Mapping paragraph formats to CSS classes |  | 22.7.4 Assigning CSS classes to table formats |