简洁的纯CSS3红色分页样式代码

创客云


这是一款红色主题的CSS3分页样式。该分页样式在bootstrap分页代码的基础上,添加一些自定义CSS样式,制作出在鼠标hover时,带幻影动画效果的红色分页主题。

使用方法

在页面中引入下面的文件。

  1. <link rel="stylesheet" type="text/css" href="path/to/bootstrap.min.css">

HTML结构

  1. <nav class="pagination-outer" aria-label="Page navigation">
  2.     <ul class="pagination">
  3.         <li class="page-item">
  4.             <a href="#" class="page-link" aria-label="Previous">
  5.                 <span aria-hidden="true">«</span>
  6.             </a>
  7.         </li>
  8.         <li class="page-item"><a class="page-link" href="#">1</a></li>
  9.         <li class="page-item active"><a class="page-link" href="#">2</a></li>
  10.         <li class="page-item"><a class="page-link" href="#">3</a></li>
  11.         <li class="page-item"><a class="page-link" href="#">4</a></li>
  12.         <li class="page-item"><a class="page-link" href="#">5</a></li>
  13.         <li class="page-item">
  14.             <a href="#" class="page-link" aria-label="Next">
  15.                 <span aria-hidden="true">»</span>
  16.             </a>
  17.         </li>
  18.     </ul>
  19. </nav>

CSS样式

  1. .pagination-outer{ text-align: center; }
  2. .pagination{
  3.     font-family: 'Oxygen', sans-serif;
  4.     display: inline-flex;
  5.     position: relative;
  6. }
  7. .pagination li a.page-link{
  8.     color: #e44251;
  9.     background-color: transparent;
  10.     font-size: 25px;
  11.     font-weight: 700;
  12.     letter-spacing: 1px;
  13.     text-transform: uppercase;
  14.     line-height: 30px;
  15.     height: 45px;
  16.     width: 45px;
  17.     margin: 0 15px 0 0;
  18.     border: 1px solid #e44251;
  19.     border-radius: 0;
  20.     position: relative;
  21.     z-index: 1;
  22.     transition: all 0.4s ease 0s;
  23. }
  24. .pagination li.active a.page-link,
  25. .pagination li a.page-link:hover,
  26. .pagination li.active a.page-link:hover{
  27.     color: #fff ;
  28.     background-color: #e44251;
  29.     border-color: #e44251;
  30. }
  31. .pagination li a.page-link:before,
  32. .pagination li a.page-link:after{
  33.     content: '';
  34.     background-color: #e44251;
  35.     height: 100%;
  36.     width: 100%;
  37.     border-radius: 50%;
  38.     transform: scale(0) rotateX(360deg);
  39.     position: absolute;
  40.     left:0 ;
  41.     top: 0;
  42.     z-index: -1;
  43.     transition: all 0.3s;
  44. }
  45. .pagination li a.page-link:after{
  46.     background-color: transparent;
  47.     border-radius: 0;
  48.     transform: scale(0.7);
  49.     transition-delay: 0.1s;
  50. }
  51. .pagination li a.page-link:hover:before{
  52.     border-radius: 0;
  53.     transform: scale(1) rotateX(0);
  54. }
  55. .pagination li a.page-link:hover:after{
  56.     background-color: #e44251;
  57.     opacity: 0;
  58.     transform: scale(1.5);
  59. }
  60. @media only screen and (max-width: 480px){
  61.     .pagination{
  62.         display: block;
  63.         border-radius: 20px;
  64.     }
  65.     .pagination li{
  66.         margin: 5px 2px;
  67.         display: inline-block;
  68.     }
  69.     .pagination li a.page-link{ margin: 0; }
  70. }
演示地址 免费下载
本文由 CityMall 整理发布如需转载,请注明出处:https://www.22vd.com/47752.html
云模板

发表评论