其他代码

纯CSS3带过渡动画分页条ui设计

阿里云


这是一款效果非常酷的纯 CSS3 带过渡动画特效的分页条 ui 设计效果。该分页条的首页、尾页、上一页和下一页按钮在鼠标滑过时,会带有非常好看的平滑拉伸动画效果。并且整个分页条带有很漂亮的阴影效果。

HTML 结构

该分页条的 HTML 结构如下:使用<section>元素来包裹一组无序列表。

也想出现在这里?联系我们
创客主机
  1. <section class="archive-pages">
  2.   <ul>
  3.     <li class="first"><a href="#" title="first page">first page</a></li>
  4.     <li class="previous"><a href="#" title="previous page">previous page</a></li>
  5.     <li class="selected">1</li>
  6.     <li><a href="#" title="Pagina 2">2</a></li>
  7.     <li><a href="#" title="Pagina 3">3</a></li>
  8.     <li><a href="#" title="Pagina 4">4</a></li>
  9.     <li><a href="#" title="Pagina 5">5</a></li>
  10.     <li class="next"><a href="#" title="next page">next page</a></li>
  11.     <li class="last"><a href="#" title="last page">last page</a></li>
  12.   </ul>
  13. </section>

CSS 样式

在 CSS 样式中,首先为分页按钮和当前激活的按钮设置基本样式。

  1. .archive-pages li a:hover{
  2.   color:#000;
  3. }
  4. .archive-pages li.selected{
  5.   color:white; 
  6. }
  7. .archive-pages a,
  8. .archive-pages a:visited{
  9.   color:#555;
  10. }
  11. .archive-pages li.selected{
  12.   color:white;
  13.   padding:5px;
  14.   width:18px;
  15.   line-height:20px;
  16.   background: rgb(53,121,214); 
  17.   background: -moz-radial-gradient(center, ellipse cover,  rgba(53,121,214,1) 0%, rgba(53,121,214,1) 91%, rgba(27,85,157,1) 100%); 
  18.   background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,rgba(53,121,214,1)), color-stop(91%,rgba(53,121,214,1)), color-stop(100%,rgba(27,85,157,1))); 
  19.   background: -webkit-radial-gradient(center, ellipse cover,  rgba(53,121,214,1) 0%,rgba(53,121,214,1) 91%,rgba(27,85,157,1) 100%); 
  20.   background: -o-radial-gradient(center, ellipse cover,  rgba(53,121,214,1) 0%,rgba(53,121,214,1) 91%,rgba(27,85,157,1) 100%); 
  21.   background: -ms-radial-gradient(center, ellipse cover,  rgba(53,121,214,1) 0%,rgba(53,121,214,1) 91%,rgba(27,85,157,1) 100%); 
  22.   background: radial-gradient(ellipse at center,  rgba(53,121,214,1) 0%,rgba(53,121,214,1) 91%,rgba(27,85,157,1) 100%);
  23.   filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3579d6', endColorstr='#1b559d',GradientType=1 ); 
  24. }
  25. .archive-pages ul{
  26.   float:left;
  27.   margin:0px;
  28.   padding:10px;
  29.   list-style:none;
  30. }
  31. .archive-pages li{
  32.   border:1px solid silver;
  33.   float:left;
  34.   font-weight:700;
  35.   margin:0 2px;
  36.   text-align:center;
  37.   border-radius: 3px; 
  38.   -moz-border-radius: 3px; 
  39.   -webkit-border-radius: 3px;  
  40.   background: -moz-linear-gradient(top,  rgba(255,255,255,0) 0%, rgba(214,214,214,1) 100%); 
  41.   background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0)), color-stop(100%,rgba(214,214,214,1))); 
  42.   background: -webkit-linear-gradient(top,  rgba(255,255,255,0) 0%,rgba(214,214,214,1) 100%); 
  43.   background: -o-linear-gradient(top,  rgba(255,255,255,0) 0%,rgba(214,214,214,1) 100%); 
  44.   background: -ms-linear-gradient(top,  rgba(255,255,255,0) 0%,rgba(214,214,214,1) 100%); 
  45.   background: linear-gradient(to bottom,  rgba(255,255,255,0) 0%,rgba(214,214,214,1) 100%); 
  46.   filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#d6d6d6',GradientType=0 );
  47. }

然后分别设置分页按钮鼠标滑过时的样式。

  1. .archive-pages li.selected:hover{
  2.   cursor:default;
  3.   background: rgb(53,121,214); 
  4.   background: -moz-radial-gradient(center, ellipse cover,  rgba(53,121,214,1) 0%, rgba(53,121,214,1) 91%, rgba(27,85,157,1) 100%); 
  5.   background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,rgba(53,121,214,1)), color-stop(91%,rgba(53,121,214,1)), color-stop(100%,rgba(27,85,157,1))); 
  6.   background: -webkit-radial-gradient(center, ellipse cover,  rgba(53,121,214,1) 0%,rgba(53,121,214,1) 91%,rgba(27,85,157,1) 100%); 
  7.   background: -o-radial-gradient(center, ellipse cover,  rgba(53,121,214,1) 0%,rgba(53,121,214,1) 91%,rgba(27,85,157,1) 100%); 
  8.   background: -ms-radial-gradient(center, ellipse cover,  rgba(53,121,214,1) 0%,rgba(53,121,214,1) 91%,rgba(27,85,157,1) 100%); 
  9.   background: radial-gradient(ellipse at center,  rgba(53,121,214,1) 0%,rgba(53,121,214,1) 91%,rgba(27,85,157,1) 100%);
  10.   filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3579d6', endColorstr='#1b559d',GradientType=1 );
  11. }
  12. .archive-pages li:hover{
  13.   background: -moz-linear-gradient(top,  rgba(255,255,255,0) 0%, rgba(196,196,196,1) 100%);
  14.   background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0)), color-stop(100%,rgba(196,196,196,1))); 
  15.   background: -webkit-linear-gradient(top,  rgba(255,255,255,0) 0%,rgba(196,196,196,1) 100%); 
  16.   background: -o-linear-gradient(top,  rgba(255,255,255,0) 0%,rgba(196,196,196,1) 100%); 
  17.   background: -ms-linear-gradient(top,  rgba(255,255,255,0) 0%,rgba(196,196,196,1) 100%);
  18.   background: linear-gradient(to bottom,  rgba(255,255,255,0) 0%,rgba(196,196,196,1) 100%);
  19.   filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#c4c4c4',GradientType=0 ); 
  20. }

首页、尾页、上一页和下一页按钮上为 width,text-indent,letter-spacing 这 3 个属性设置动画过渡效果。并且在鼠标滑过这写按钮时,相应的修改这些属性的值。

  1. .archive-pages .first a,
  2. .archive-pages .previous a,
  3. .archive-pages .next a,
  4. .archive-pages .last a{
  5.   overflow:hidden;
  6.   white-space:nowrap;
  7.   -webkit-transition-duration: 300ms;
  8.   -webkit-transition-property: width,text-indent,letter-spacing;
  9.   -webkit-transition-timing-function: ease;
  10.   -moz-transition-duration: 300ms;
  11.   -moz-transition-property: width,text-indent,letter-spacing;
  12.   -moz-transition-timing-function: ease;
  13.   -o-transition-duration: 300ms;
  14.   -o-transition-property: width,text-indent,letter-spacing;
  15.   -o-transition-timing-function: ease;
  16.   transition-duration: 300ms;
  17.   transition-property: width,text-indent,letter-spacing;
  18.   transition-timing-function: ease;
  19. }
  20. .archive-pages .first a:hover,
  21. .archive-pages .previous a:hover,
  22. .archive-pages .next a:hover,
  23. .archive-pages .last a:hover{
  24.   width: 100px;
  25.   text-indent:0;
  26.   letter-spacing:0px;
  27. }
  28. .archive-pages .first a{
  29.   text-indent:+6px;
  30.   letter-spacing:10px;
  31. }
  32. .archive-pages .previous a{
  33.   text-indent:+7px;
  34.   letter-spacing:10px;
  35. }
  36. .archive-pages .next a{
  37.   text-indent:-159px;
  38.   letter-spacing:10px;
  39. }
  40. .archive-pages .last a{
  41.     text-indent:-154px;
  42.   letter-spacing:10px;
  43. }

完整的分页样式代码可以参看下载文件的 style.css 文件。

纯 CSS3 带过渡动画分页条 ui 设计

已有 413 人购买
查看演示升级 VIP立刻购买

演示地址
收藏
(0)

发表回复

热销模板

Ashade - 作品展示摄影相册WordPress汉化主题
LensNews

本站承接 WordPress / PbootCMS / DedeCMS 等
系统建站、仿站、开发、定制等业务!