Skip to content
Related Articles

Related Articles

Primer CSS Pagination

Improve Article
Save Article
  • Last Updated : 25 Apr, 2022
Improve Article
Save Article

Primer CSS is a free open-source CSS framework that is built upon systems that create the foundation of the basic style elements such as spacing, typography, and color. This systematic method makes sure our patterns are steady and interoperable with every other. Its approach to CSS is influenced by Object-Oriented CSS principles, functional CSS, and BEM architecture. It is highly reusable and flexible. It is created with GitHub’s design system.

Primer CSS Pagination is used to create the set of pages and we can jump to any page if we want. We can go to previous, next, and numbered pages.

Primer CSS Pagination Classes:

  • paginate-container: This class is used to create the pagination container.
  • pagination: This class is used to create pagination.
  • previous_page: This class is used to go to the previous page.
  • next_page: This class is used to go to the next page.

Syntax:

<nav class="paginate-container">
  <div class="pagination">
    <span class="previous_page" aria-disabled="true">
         ... 
    </span>
    <a href="#" aria-label="..."> ... </a>
    <a class="next_page" rel="next" href="#">
        ...
    </a>
  </div>
</nav>

Example 1: This example demonstrates the implementation of Primer CSS Pagination.

HTML




<!DOCTYPE html>
<html>
  
<head>
    <title> Primer CSS Pagination </title>
    <link rel="stylesheet" href=
"https://unpkg.com/@primer/css@^18.0.0/dist/primer.css" /> 
</head>
  
<body>
    <div class="text-center">
        <h1 class="color-fg-success"> GeeksforGeeks </h1>
        <h3> Primer CSS Pagination </h3> <br>
  
        <nav class="paginate-container">
            <div class="pagination">
                <span class="previous_page" href="#">
                    Previous
                </span>
                <a class="next_page" href="#" >
                    Next
                </a>
            </div>
        </nav>
    </div>
</body>
  
</html>


Output:

Primer CSS Pagination

Example 2: This example demonstrates the implementation of Primer CSS Pagination.

HTML




<!DOCTYPE html>
<html>
  
<head>
    <title> Primer CSS Pagination </title>
    <link rel="stylesheet" href=
"https://unpkg.com/@primer/css@^18.0.0/dist/primer.css" /> 
</head>
  
<body>
    <div class="text-center">
        <h1 class="color-fg-success"> GeeksforGeeks </h1>
        <h3> Primer CSS Pagination </h3> <br>
  
        <nav class="paginate-container">
            <div class="pagination">
                <span class="previous_page" href="#">
                    Previous
                </span>
                <em aria-current="Page1"> 1 </em>
                <a href="#" aria-label="2"> 2 </a>
                <a href="#" aria-label="3"> 3 </a>
                <span class="gap">…</span>
                <a href="#" aria-label="11"> 11 </a>
                <a href="#" aria-label="12"> 12 </a>
                <a class="next_page" href="#" >
                    Next
                </a>
            </div>
        </nav>
    </div>
</body>
  
</html>


Output:

Primer CSS Pagination.

Reference: https://primer.style/css/components/pagination


My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!