分页数字css,CSS分页

CSS 分页 示例

Learn how to create a responsive pagination using CSS.

Simple 分页

If you have a website with lots of pages, you may wish to add some sort of

pagination to each page:

例子

.pagination {

display: inline-block;

}

.pagination a {

color:

black;

float: left;

padding: 8px

16px;

text-decoration: none;

}

来试试吧 »

Active and Hoverable 分页

Highlight the current page with an .active

class, and use the :hover

selector to change the color of each page link when moving the mouse over them:

例子

.pagination a.active {

background-color:

#4CAF50;

color: white;

}

.pagination a:hover:not(.active) {background-color: #ddd;}

来试试吧 »

Rounded Active and Hoverable Buttons

Add the border-radius property if you want a rounded "active" and "hover" button:

例子

.pagination a {

border-radius: 5px;

}

.pagination a.active {

border-radius: 5px;

}

来试试吧 »

Hoverable Transition Effect

Add the transition property to the page links to create a transition effect on hover:

例子

.pagination a {

transition: background-color .3s;

}

来试试吧 »

Bordered 分页

Use the border property to add borders to the pagination:

例子

.pagination a {

border: 1px solid #ddd; /* Gray

*/

}

来试试吧 »

Rounded 边框

Tip: Add rounded borders to your first and last link in the

pagination:

例子

.pagination a:first-child {

border-top-left-radius:

5px;

border-bottom-left-radius: 5px;

}

.pagination

a:last-child {

border-top-right-radius: 5px;

border-bottom-right-radius: 5px;

}

来试试吧 »

Space Between Links

Tip: Add the margin property if you do not want to group the page links:

例子

.pagination a {

margin: 0 4px; /* 0 is for top

and bottom. Feel free to change it */

}

来试试吧 »

分页 Size

Change the size of the pagination with the font-size property:

例子

.pagination a {

font-size: 22px;

}

来试试吧 »

Centered 分页

To center the pagination, wrap a container element (like

) around it with text-align:center

例子

.center {

text-align: center;

}

来试试吧 »

More 示例

面包屑

Another variation of pagination is so-called "breadcrumbs":

例子

ul.breadcrumb {

padding: 8px 16px;

list-style: none;

background-color: #eee;

}

ul.breadcrumb li {display: inline;}

ul.breadcrumb li+li:before {

padding: 8px;

color: black;

content: "/\00a0";

}

来试试吧 »

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值