4. Changing Appearances

4.1. Overriding the CSS Rules
4.2. Overriding Javascript
4.3. Overriding Graphics

As DocBook is converted into the page/pages/slides output formats, the conversion process mainly deals in the order in which things appear. The actual appearances are generally left to CSS style sheets. For example, if you were, in one of your documents, to create a program listing:

int x = 0;

and then look at the HTML generated from that you would probably see something like

<pre class="programlisting">
<b class="hl-keyword">int</b> x = <span class="hl-number">0</span>;
</pre>

There's nothing directly in that HTML that indicates that the keyword "int" should appear in bold, that program listings appear on a grey background , etc. Those decisions are made via CSS.

Most DocBook elements are translated into a basic HTML element with a class attribute that refers back to the original DocBook.

When you build the document set, within your output directory a directory named "shared" is created. Into this file is copied a basic set of CSS stylesheets, graphics (e.g., navigation icons), and Javascript files.

Most important of these is docbook.css, the basic set of instructions for rendering HTML generated from DocBook, and slides.css, a set of modifications to the docbook.css rules for slides (mainly uses larger fonts and allows for a background graphic).