Summary

Structure indexes using sections and lists to simplify access to the subjects.

Techniques

Examples

Example 1 — An index with explicit headings

<nav role="doc-index">
   <h1>Subject Index</h1>
   
   <section>
     <h2>A</h2>
     
     <ul>
       <li>
         Apples, <a href="#page01">1</a>, 
         <a href="#page27">27</a>
       </li>
       …
     </ul>
   </section>
   
   …
</nav>

Example 2 — An index with implicit headings

If the sets of index entries are only separated by a visual space, use the aria-label attribute to provide a heading for assistive technologies.

<nav role="doc-index">
   <h1>Index</h1>
   
   <section aria-label="A">
     <ul>
       <li>
         Apples, <a href="#page01">1</a>, 
         <a href="#page27">27</a>
       </li>
       …
     </ul>
   </section>
   
   <section aria-label="B">
     <ul>
       <li>
         Blueberries, <a href="#page01">1</a>, 
         <a href="#page27">27</a>
       </li>
       …
     </ul>
   </section>
   
   …
</nav>

Example 3 — An index with a header

Use a header element to group any preliminary information before the lists of index entries.

<nav role="doc-index">
   <header>
      <h1>Index</h1>
      
      <p>This is an index to the main text …</p>
	
      <p>Alphabetization is word-by-word: …</p>
   </header>
   
   …
</nav>

Frequently Asked Questions

Should I follow the EPUB Indexes specification?

Following the structuring principles in the document is advised, and the most useful for accessibility are repeated in this page, but the use of epub:type semantics is not necessary. While these semantics may be useful for internal publisher workflows, they do not currently enhance indexes in reading systems and the epub:type semantics provide no accessibility.

Given the limited uptake of the specification at this time, there is no need to follow the package document identification requirements of the specification.

Should I use the nav or section element for the index?

While both are technically acceptable, preference should be given to the nav element. An index is a navigation aid not dissimilar from the table of contents — it is a list of links to key areas of the content.

How should I link a topic that covers a range of pages?

If a topic includes a page range, tag the entire range and link it to the first page:

<a href="c02.xhtml#pg49" aria-label="49 to 51">49–51</a>

Avoid linking to the first and last pages, or trying to split the range up and link each individual page. The meaning of index entries is well established, so turning the range into a series of pages may confuse the reader about the extent of discussion, especially if using an assistive technology that does not announce the punctuation.

Make sure to include page break markers in the text so that the user can determine when they've reached the end of the range.

Explanation

To facilitate navigating the alphabetically and numerically related entries of an index, use nested section elements. Many indexes include the number or letter as a heading between each set of entries, but if one is not present or wanted, include the number or letter in an aria-label attribute on the enclosing section so that it can be announced by assistive technologies. Also, without an explicit or implicit heading, assistive technologies often will not provide the ability to move from one section to another (they are treated like purely stylistic elements).

Structure the entries in each section using unordered lists, as the alphatized order of the entries is not significant (e.g., an index can be reverse sorted without loss of information). The use of lists allows users of assistive technologies to jump forward and backward through the list items instead of having to move through each one at a time as would result if paragraphs or similar markup is used.

The use of lists not only simplifies navigation, but it also allows the position within the list to be announced, allowing the user to quickly return to the same spot again later, if needed.

The optimal way to reference into digital publications is still evolving, but many publications use static page break markers. These do not have to match a print source; they can be added for purely digital works to ensure stable referencing from indexes.

Related Links