CSS pagination

CSS Pagination Example

In this chapter we will introduce how to create a paging example by using CSS.

Simple paging

If your website has many pages, you need to use paging to navigate each page.

The following example demonstrates how to use HTML and CSS to create pagination:

    php中文网(php.cn)  

简单的分页

Run and try it


##Click and mouseover pagination Style

If you click on the current page, you can use .active to set the current page style. When hovering the mouse, you can use the :hover selector to modify the style:

    php中文网(php.cn)  

点击及鼠标悬停分页样式

移动鼠标的分页的数字上。

Run try Just


Rounded corner style

Okay Use the border-radius attribute to add a rounded corner style to the selected page number:

    php中文网(php.cn)  

圆角样式

Run and try it


Mouseover transition effect

We can add a transition effect when the mouse moves to the page number by adding the transition attribute

    php中文网(php.cn)  

鼠标悬停过渡效果

鼠标移动到分页码上。

Run it and try it


Bordered paging

We can use the border attribute to add bordered paging:

    php中文网(php.cn)  

带边框分页

Run and try it


Rounded border

##Tips: Link in the first page And add rounded corners to the last pagination link:

    php中文网(php.cn)  

圆角边框

Run and try it


Page interval

Tips: You can use the margin attribute to add spaces directly to each page number:

    php中文网(php.cn)  

分页间隔

Run and try it


Pagination font size

We can use the font-size attribute to set the pagination font size:

    php中文网(php.cn)  

分页字体大小

我们可以使用 font-size 属性来设置分页的字体大小:

Run it and try it


Centered paging

If you want the paging to be centered, you can add the text-align:center style on the container element (such as
):

    php中文网(php.cn)  

分页居中

Run and try it


##Breadcrumb navigationAnother type of navigation is breadcrumb navigation. The example is as follows:

    php中文网(php.cn)  

面包屑导航

Run and try it


Continuing Learning
||
php中文网(php.cn)

分页居中

submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!