s72
  • Pagination

    data-pages

    <nav data-pages> is a row of page links. The current page is aria-current="page"; a <span> stands in for a gap in the run.

    Basic

    html
    <nav data-pages aria-label="Pages">
      <a href="?p=1">1</a>
      <a href="?p=2" aria-current="page">2</a>
      <a href="?p=3">3</a>
      <span>…</span>
      <a href="?p=12">12</a>
    </nav>

    The current page stays a link and is marked with aria-current="page" rather than taken out of the row.

    Previous and next

    html
    <nav data-pages aria-label="Guide pages">
      <a rel="prev" href="install.html">Install</a>
      <a rel="next" href="folder-layout.html">Folder layout</a>
    </nav>

    rel="prev" and rel="next" turn a link into a text link with its arrow beside it. Name the page it leads to and leave the arrow to the stylesheet.

    Notes