Skip to main content

CSS Pagination Styles

Advanced pagination styling is the topic here: hover effects, transitions, and breadcrumbs.


Pagination with Hover Effect

A page link can change its background color as the mouse moves over it, thanks to the :hover selector.

Example

Only the non-active links react to hovering in this pagination:

Prompt
Create a pagination bar with previous/next arrows and page numbers 1-5. Style the active page with a blue background and white text. Add a hover effect that changes the background color to light gray on non-active links.
Output: complete HTML page

Transition Effect on Hover

For a smooth animation while hovering, give the page links the transition property.

Example

On hover, the background color now changes gradually thanks to a transition effect:

Prompt
Create a pagination bar with previous/next arrows and page numbers 1-5. Style the links with a border, border-radius, and padding. Add a CSS transition so the background color change on hover animates smoothly over 1 second.
Output: complete HTML page

Breadcrumb Pagination

A breadcrumb is a further kind of pagination. It displays the path leading to the current page as links, with a character like "/" between them.

Example

Separators sit between the items of this breadcrumb navigation:

Prompt
Create a breadcrumb navigation with four items: Home, Pictures, Summer 25, and Italy. Style it with a light gray background, no list bullets, inline items, green link color, and a "/" separator between items using CSS content.
Output: complete HTML page