SSP - Single standard for pagination

SSP - Single standard for pagination

148

1 min.

The SSP standard defines requirements for the semantics, accessibility, and logic of page-by-page navigation.

Structure

The entire pagination block is wrapped in a <nav> tag to indicate the navigation area. Page numbers should be implemented as an ordered list <ol>. The back and forward buttons are placed inside the <nav> tag, before and after the list, respectively.

Behavior and accessibility

The active page is always marked with the aria-current="page" attribute for screen readers to work correctly. Back and forward links must be blocked and become inactive when the first and last pages are reached. The current page must be highlighted with a visually contrasting style. If there are a large number of pages, ellipses are used to separate the first, last, and central groups of links.

Final example

<nav class="pagination">
  <a href="#" class="pagination__link disabled">Previous</a>
  <ol class="pagination__list">
    <li>
      <a href="?page=1" class="pagination__link">1</a>
    </li>
    <li>
      <span class="pagination__ellipsis">...</span>
    </li>
    <li>
      <a href="?page=4" class="pagination__link">4</a>
    </li>
    <li>
      <a href="?page=5" class="pagination__link active" aria-current="page">5</a>
    </li>
    <li>
      <a href="?page=6" class="pagination__link">6</a>
    </li>
    <li>
      <span class="pagination__ellipsis">...</span>
    </li>
    <li>
      <a href="?page=20" class="pagination__link">20</a>
    </li>
  </ol>
  <a href="?page=6" class="pagination__link">Next</a>
</nav>

The article will be supplemented

Similar categories:

Similar articles

  • SSA - Single Standard for Accordion

    The SSA standard defines requirements for the semantics, accessibility, and logic of accordion operation.

    200

    2 min.

  • Bad Practices for Websites

    An Analysis of Critical Web Design Mistakes. Why Sliders, Autoplay, and Slow-Loading Pages Reduce Conversion Rates and Rankings on Google and Yandex

    46

    2 min.

  • SSPS - Single Standard for Project Structure

    The SSPS standard defines requirements for the structure and naming of files and folders in a project

    95

    2 min.

  • SSV - Single Standard for Video

    The SSV standard defines requirements for semantics, background and interactive video settings, attributes for Safari, accessibility rules, and video weight

    140

    4 min.

  • How to use Vite with VPN enabled, quick solution

    Troubleshooting Vite issues when using a VPN, configuring the connection to prevent local traffic from being redirected through the VPN tunnel

    185

    2 min.

Contact me

Project type*