Both XHTML and HTML Help outputs are formatted by the same set of XHTML
stylesheets. When building HTML Help, additional build steps create the content,
index, project files etc and compile them into a CHM file. The simplest way to
customize HTML output is by modifying the CSS styles used. This can be achieved in
one of two ways:
- Creating an additional CSS stylesheet and adding the appropriate properties
to the ANT build script to associate it with the HTML files.
- Associating individual DITA content elements with a CSS class in a custom
stylesheet using the outputclass attribute.
There are two approaches to applying styles in CSS:
- Create named styles and apply them to tags in the output HTML page individually.
- Create named styles in the CSS stylesheet by prefacing the name with a period
(.) character; then apply the style to an HTML tag using the class element. For
e.g., in the CSS: .mystyle {color:red}; and respectively in the HTML:
<div class="mystyle">/>
CSS stylesheet files are associated with an HTML page using the
<link> tag in the <head> section
of the HTML. In the DITA Open Toolkit, the default spreadsheet
"commonltr.css" is copied to the output directory and
associated with each HTML page when building the XHTML output.