As mentioned in EPUB Style Rules, all projects must use EPUB 3 Structural Semantics Vocabulary wherever possible.
A good understanding of this vocabulary is essential to a well-formed EPUB, and some sections will be required in every project.
In general, use the structural vocabulary along with the HTML <section>
tag.
Document Partitions
Every EPUB we develop will have multiple frontmatter
partitions, and most will also have backmatter
.
<body epub:type="frontmatter"> |
Document Divisions
The most common division we use is the chapter
, and another relevant division, although it occurs much less frequently, is the part
. For our EPUBs, parts should always be hierarchically one level above the chapter level and always at the same level throughout the entire book. They should not be used below the chapter level or as sub-part sections.
Chapter content should be placed in one file per chapter. Part content, whether it’s only a title or made up of many large sections, should also be placed in its own file, with one file per part. Use both where applicable in body matter files.
Include the bodymatter
EPUB type with the <body>
tag for all chapter and part documents.
<!-- Division by chapter --> |
Document Sections
Most of the document sections you will encounter from day to day are referenced here. Follow the structure outlines, but also make sure to consult Document sections and components section of the EPUB vocabulary for the full list of document section types and use them where applicable.
Each frontmatter or backmatter section should be in its own XHTML document.
Any preliminary sections that appear before the first chapter should be nested in the body of a frontmatter
document.
Any ancillary sections that appear after the final chapter should be nested in a backmatter
document.
Some document sections may also occur within chapters. When this is the case, simply nest a <section>
within the chapter
section, with the appropriate epub:type
.
For footnotes within chapters (rather than in the backmatter), use a <footer>
tag instead.
<!-- Sections occurring before the first chapter --> |