Some authors take time to think about the structure of books – section headings, chapter headings and the like – while some are a bit more blasé about it. However, it’s important to do it correctly, in terms of navigation, as a consistent visual pointer for the reader and for technical reasons such as whether or not a heading appears in a table of contents. And also that you can define styles for them and change their appearance throughout the book very quickly.
In HTML (and by relation Kindle format), you can have six descending levels of headings, from <h1> to <h6>.
A simple novel
Let’s take the simplest example – a novel with twenty-five chapters. All you need to do is to make sure all your chapter headings are tagged with <h1>.
Chapter 1
<p>It was a dark and stormy night; the rain fell in torrents — except at occasional intervals, when it was checked by a violent gust of wind which swept up the streets (for it is in London that our scene lies), rattling along the housetops, and fiercely agitating the scanty flame of the lamps that struggled against the darkness.</p>
A book in parts
However, let’s suppose you split your book into three parts. <h1> now corresponds to the part and <h2> is now the chapter style.
Part 1
Chapter 1
<p>It was a dark and stormy night; the rain fell in torrents — except at occasional intervals, when it was checked by a violent gust of wind which swept up the streets (for it is in London that our scene lies), rattling along the housetops, and fiercely agitating the scanty flame of the lamps that struggled against the darkness.</p>
And of course, if you want to have some subheadings, they’ll be <h3>.
If you’re writing something quite long and technical, with lots of headings, it’s easy to forget where in the hierarchy you are.
Defining Structure
Most word processors feature the same principle I’ve outlined above. In MS Word, for example, if you go to Format > Styles and Formatting, some built-in headings are displayed in the right-hand pane – typically Heading 1, Heading 2 and Heading 3. These correspond exactly to <h1>, <h2> and <h3> and can be carried into the HTML, which is an easier option than trawling through code and doing it manually. So I highly recommend you use this feature – all you need to do is select your heading text and click on the style. In addition, once you’ve defined all your headings, you can use Word’s automatic table of contents function, which is very useful for displaying the structure of long books.