Next / Previous / Contents / NM Tech homepage

10.2. docbook5.css: General page layout

The first rule applies to the HTML body tag, and sets up the general color scheme. The background is a pale tan and the text a coffee-brown, appropriate for a university in the desert. The max-width rule keeps paragraph widths to a reasonable maximum, yet still allows room for the standard 75-character width limit for verbatim output. The margin-left rule keeps the text from slamming up against the left side.

docbook5.css
body
{   background-color: #ffffdd;
    color:            #663300;
    max-width: 50em;
    margin-left: 1em;
}

We don't use HTML h1 titles, but the various levels of DocBook section tags do generate HTML h2, h3, and h4 titles. To make these titles stand out better, they are placed inside a ruled box. The background color inside the box is a darker tan, with the borders using the text color. We don't change the font sizes, which should be smaller at each level, but we do use less padding around the h3 and h4 headings.

docbook5.css
h2.title               /* sect1 titles */
{   background-color: #ffe2a0;
    border-style: solid;
    border-color: #663300;
    padding: 4px;
}
h3.title, h4.title      /* sect2 and sect3 titles */
{   background-color: #ffe2a0;
    border-style: solid;
    border-color: #663300;
    padding: 2px;
}

Next we stipulate a minimum padding within table cells.

docbook5.css
th, td
{   padding: 5px;
}