4. Adding a custom CSS style sheet
Prev | Chapter 5. Customizing an existing configuration | Next

## 4. Adding a custom CSS style sheet

Procedure:

1. Copy one of the following files depending on which configuration you want to customize:

   Configuration Name | Procedure
   --- | ---
   DITA | Copy topic.css to `custom/`.
   DITA Map | Copy map.css to `custom/`.
   DITA BookMap | Copy bookmap.css to `custom/`.
   DocBook v5+ | Copy docbook5.css to `custom/`.
   DocBook | Copy docbook.css to `custom/`.
   XHTML Strict XHTML Transitional XHTML 1.1 XHTML 5 | Copy xhtml.css to `custom/`.

   For example, `xhtml.css` looks like this:

       @import url(xhtml-config:css/xhtml.css);

2. Edit this file using a text editor and add one or more CSS rules after the `@import` directive.

   XHTML example:

       p {
           color: red;
       }

   DocBook, DocBook v5+ example:

       para {
           color: red;
       }

3. Check your CSS file using the csscheck command-line utility. This utility is found in ``XXE_install_dir`/bin/`. Example:

       $ /opt/xxe/bin/csscheck stylesheet1.css

4. Let's suppose this file is called `stylesheet1.css` and that you want your style sheet to be listed in the View menu as "`Style sheet #1`".

   Add the following css configuration element to your custom `.xxe` file:

       <css name="Style sheet #1"
            location="stylesheet1.css"
            alternate="true" />

5. If you want to make your custom CSS style sheet the default one, add the following windowLayout configuration element:

       <windowLayout>
         <center css="Style sheet #1" />
       </windowLayout>

Prev | Up | Next
3. Removing an existing document template | Home | 5. Replacing an existing CSS style sheet