Semantic Markup in EPUB 3
EPUB 3 books can be created from HTML5, and the same principles for creating well-formed, semantically sound web content apply. For an EPUB 3 author, there are two tools available: HTML 5 semantic elements, and epub:type
.
HTML 5 semantic markup gives meaning to otherwise anonymous containers or text structures. For example, you can use the <section>
element to denote changes in topic, or <aside>
to indicate content that is secondary in importance.
EPUB 3 also provides semantics more suitable for publications. In addition to using HTML 5 semantic markup, you can describe the same HTML 5 markup as being chapters, or as a sidebar.
Here is an example:
<section epub:type="chapter">
<h1>Chapter 1: At the Start</h1>
We always start with a good idea.
<aside epub:type="sidebar">
In 2013, 9 out of 10 ideas were great.
</aside>
</section>
The “EPUB 3 Content Document” article by Matt Garrish is a great place to start learning about semantics in EPUB 3: http://epubzone.org/news/epub-3-content-documents.
Further reading
- “The epub:type attribute” - by IDPF
- “Let’s Talk about Semantics” - by Mike Robinson, html5doctor.com
- “EPUB 3 Structural Semantics Vocabulary” - by IDPF
- “EPUB 3 semantic tags” - by Helicon Books