# Pagination

> Rounded pagination buttons with a clear current page and ellipsis.

- Category: [CSS Navigation](https://copy-css.com/category/navigation)
- Tags: pagination, pages, navigation, buttons
- Live preview: https://copy-css.com/snippets/pagination
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<nav class="pagination" aria-label="Pagination">
  <a href="#" aria-label="Previous page">‹</a>
  <a href="#">1</a>
  <a href="#" aria-current="page">2</a>
  <span>…</span>
  <a href="#">9</a>
  <a href="#" aria-label="Next page">›</a>
</nav>
```

## CSS

```css
.pagination {
  display: flex;
  gap: 6px;
  font: 600 14px system-ui, sans-serif;
}

.pagination a,
.pagination span {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  min-width: 36px;
  height: 36px;
  padding: 0 6px;
  border-radius: 10px;
  color: #374151;
  text-decoration: none;
}

.pagination a {
  border: 1px solid #e5e7eb;
  background: #fff;
  transition: border-color 0.15s ease;
}

.pagination a:hover {
  border-color: #111;
}

.pagination [aria-current="page"] {
  border-color: #111;
  background: #111;
  color: #fff;
}

.pagination span {
  color: #9ca3af;
}
```

## Notes

- This CSS Pagination is 38 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses transitions, CSS Grid and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
