CSS3翻页按钮

按钮样式图

​在CSS当中设定按钮的样式,颜色、阴影、大小、圆角、文字颜色、大小、线性渐变等属性:

.button {

display: inline-block;

position: relative;

color: #888;

text-shadow: 0 1px 0 rgba(255,255,255, 0.8);

text-decoration: none;

text-align: center;

padding: 8px 12px;

font-size: 12px;

font-weight: 700;

font-family: helvetica, arial, sans-serif;

border-radius: 4px;

border: 1px solid #bcbcbc;

-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.12);

box-shadow: 0 1px 3px rgba(0,0,0,0.12);

background-image: -webkit-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(239,239,239,1) 60%,rgba(225,223,226,1) 100%);

background-image: -moz-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(239,239,239,1) 60%,rgba(225,223,226,1) 100%);

background-image: -o-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(239,239,239,1) 60%,rgba(225,223,226,1) 100%);

background-image: -ms-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(239,239,239,1) 60%,rgba(225,223,226,1) 100%);

background-image: linear-gradient(top, rgba(255,255,255,1) 0%,rgba(239,239,239,1) 60%,rgba(225,223,226,1) 100%);

}

然后设定上一页与下一页的按钮不同的样式

上一页:

.button.back {

border-left: none;

}

.button.back:after {

content: '';

position: absolute;

height: 50%;

width: 15px;

border-left: 1px solid #bcbcbc;

background-image: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 1%,rgba(240,240,240,1) 100%);

background-image: -moz-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 1%,rgba(240,240,240,1) 100%);

background-image: -o-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 1%,rgba(240,240,240,1) 100%);

background-image: -ms-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 1%,rgba(240,240,240,1) 100%);

background-image: linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 1%,rgba(240,240,240,1) 100%);

left: -5px;

top: 1px;

-webkit-transform: skew(-35deg, 0);

-moz-transform: skew(-35deg, 0);

-o-transform: skew(-35deg, 0);

-ms-transform: skew(-35deg, 0);

transform: skew(-35deg, 0);

}

.button.back:before {

content: '';

position: absolute;

height: 48%;

width: 15px;

border-left: 1px solid #bcbcbc;

bottom: 1px;

left: -5px;

-webkit-transform: skew(35deg, 0);

-moz-transform: skew(35deg, 0);

-o-transform: skew(35deg, 0);

-ms-transform: skew(35deg, 0);

transform: skew(35deg, 0);

background-image: -webkit-linear-gradient(top, rgba(240,240,240,1) 0%,rgba(239,239,239,1) 10%,rgba(225,223,226,1) 100%);

background-image: -moz-linear-gradient(top, rgba(240,240,240,1) 0%,rgba(239,239,239,1) 10%,rgba(225,223,226,1) 100%);

background-image: -o-linear-gradient(top, rgba(240,240,240,1) 0%,rgba(239,239,239,1) 10%,rgba(225,223,226,1) 100%);

background-image: -ms-linear-gradient(top, rgba(240,240,240,1) 0%,rgba(239,239,239,1) 10%,rgba(225,223,226,1) 100%);

background-image: linear-gradient(top, rgba(240,240,240,1) 0%,rgba(239,239,239,1) 10%,rgba(225,223,226,1) 100%);

-webkit-box-shadow: -2px 1px 2px rgba(100,100,100,0.1);

box-shadow: -2px 1px 2px rgba(100,100,100,0.1);

}

下一页:

.button.next {

border-right: none;

}

.button.next:after {

content: '';

position: absolute;

height: 48%;

width: 15px;

border-right: 1px solid #bcbcbc;

background-image: -webkit-linear-gradient(top, rgba(240,240,240,1) 0%,rgba(239,239,239,1) 10%,rgba(225,223,226,1) 100%);

background-image: -moz-linear-gradient(top, rgba(240,240,240,1) 0%,rgba(239,239,239,1) 10%,rgba(225,223,226,1) 100%);

background-image: -o-linear-gradient(top, rgba(240,240,240,1) 0%,rgba(239,239,239,1) 10%,rgba(225,223,226,1) 100%);

background-image: -ms-linear-gradient(top, rgba(240,240,240,1) 0%,rgba(239,239,239,1) 10%,rgba(225,223,226,1) 100%);

background-image: linear-gradient(top, rgba(240,240,240,1) 0%,rgba(239,239,239,1) 10%,rgba(225,223,226,1) 100%);

right: -5px;

bottom: 1px;

-webkit-transform: skew(-35deg, 0);

-moz-transform: skew(-35deg, 0);

-o-transform: skew(-35deg, 0);

-ms-transform: skew(-35deg, 0);

transform: skew(-35deg, 0);

-webkit-box-shadow: 2px 1px 2px rgba(100,100,100,0.1);

box-shadow: 2px 1px 2px rgba(100,100,100,0.1);

}

.button.next:before {

content: '';

position: absolute;

background-image: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 1%,rgba(240,240,240,1) 100%);

background-image: -moz-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 1%,rgba(240,240,240,1) 100%);

background-image: -o-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 1%,rgba(240,240,240,1) 100%);

background-image: -ms-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 1%,rgba(240,240,240,1) 100%);

background-image: linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 1%,rgba(240,240,240,1) 100%);

height: 50%;

width: 15px;

border-right: 1px solid #bcbcbc;

top: 1px;

right: -5px;

-webkit-transform: skew(35deg, 0);

-moz-transform: skew(35deg, 0);

-o-transform: skew(35deg, 0);

-ms-transform: skew(35deg, 0);

transform: skew(35deg, 0);

}


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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值