表单/表格

CSS3超精美实用价格表动画特效

阿里云


这是一款使用纯 css3 制作的超级精美实用的价格表动画特效。该 css3 价格表动画特效在鼠标移动到价格表上时,价格表会放大,鼠标移出时,价格表恢复原样。

HTML 结构

html 结构使用 div 的嵌套结构来制作这个价格表。

也想出现在这里?联系我们
创客主机
  1. <div class="pricing-wrapper clearfix">
  2.     <div class="pricing-table">
  3.         <h3 class="pricing-title">Basico</h3>
  4.         <div class="price">$60<sup>/ mes</sup></div>
  5.         <!-- Lista de Caracteristicas / Propiedades -->
  6.         <ul class="table-list">
  7.             <li>10 GB <span>De almacenamiento</span></li>
  8.             <li>1 Dominio <span>incluido</span></li>
  9.             <li>25 GB <span>De transferencia mensual</span></li>
  10.             <li>Base de datos <span class="unlimited">ilimitadas</span></li>
  11.             <li>Cuentas de correo <span class="unlimited">ilimitadas</span></li>
  12.             <li>CPanel <span>incluido</span></li>
  13.         </ul>
  14.         <!-- Contratar / Comprar -->
  15.         <div class="table-buy">
  16.             <p>$60<sup>/ mes</sup></p>
  17.             <a href="#" class="pricing-action">Contratar</a>
  18.         </div>
  19.     </div>
  20. </div>

CSS 样式

下面来给价格表添加一些样式。首先重置一下浏览器的样式:

  1. * {
  2.     margin: 0;
  3.     padding: 0;
  4.     -webkit-box-sizing: border-box;
  5.     -moz-box-sizing: border-box;
  6.     box-sizing: border-box;
  7. }
  8. body {
  9.     background: #2e2a2a;
  10.     color: #FFF;
  11.     font-size: 62.5%;
  12.     font-family: 'Roboto', Arial, Helvetica, Sans-serif, Verdana;
  13. }
  14. ul {
  15.     list-style-type: none;
  16. }
  17. a {
  18.     color: #e95846;
  19.     text-decoration: none;
  20. }
  21. .clearfix:after {
  22.     content: '';
  23.     display: block;
  24.     height: 0;
  25.     width: 0;
  26.     clear: both;
  27. }

接着给价格表一些基本样式:

  1. /** ========================
  2.  * Contenedor
  3.  ============================*/
  4. .pricing-wrapper {
  5.     width: 960px;
  6.     margin: 40px auto 0;
  7. }
  8.  
  9. .pricing-table {
  10.     margin: 0 10px;
  11.     text-align: center;
  12.     width: 300px;
  13.     float: left;
  14.     -webkit-box-shadow: 0 0 15px rgba(0,0,0,0.4);
  15.     box-shadow: 0 0 15px rgba(0,0,0,0.4);
  16.     -webkit-transition: all 0.25s ease;
  17.     -o-transition: all 0.25s ease;
  18.     transition: all 0.25s ease;
  19. }
  20.  
  21. .pricing-table:hover {
  22.     -webkit-transform: scale(1.06);
  23.     -ms-transform: scale(1.06);
  24.     -o-transform: scale(1.06);
  25.     transform: scale(1.06);
  26. }
  27.  
  28. .pricing-title {
  29.     color: #FFF;
  30.     background: #e95846;
  31.     padding: 20px 0;
  32.     font-size: 2em;
  33.     text-transform: uppercase;
  34.     text-shadow: 0 1px 1px rgba(0,0,0,0.4);
  35. }
  36.  
  37. .pricing-table.recommended .pricing-title {
  38.     background: #2db3cb;
  39. }
  40.  
  41. .pricing-table.recommended .pricing-action {
  42.     background: #2db3cb;
  43. }
  44.  
  45. .pricing-table .price {
  46.     background: #403e3d;
  47.     font-size: 3.4em;
  48.     font-weight: 700;
  49.     padding: 20px 0;
  50.     text-shadow: 0 1px 1px rgba(0,0,0,0.4);
  51. }
  52.  
  53. .pricing-table .price sup {
  54.     font-size: 0.4em;
  55.     position: relative;
  56.     left: 5px;
  57. }
  58.  
  59. .table-list {
  60.     background: #FFF;
  61.     color: #403d3a;
  62. }
  63.  
  64. .table-list li {
  65.     font-size: 1.4em;
  66.     font-weight: 700;
  67.     padding: 12px 8px;
  68. }
  69.  
  70. .table-list li:before {
  71.     content: "\f00c";
  72.     font-family: 'FontAwesome';
  73.     color: #3fab91;
  74.     display: inline-block;
  75.     position: relative;
  76.     right: 5px;
  77.     font-size: 16px;
  78. } 
  79.  
  80. .table-list li span {
  81.     font-weight: 400;
  82. }
  83.  
  84. .table-list li span.unlimited {
  85.     color: #FFF;
  86.     background: #e95846;
  87.     font-size: 0.9em;
  88.     padding: 5px 7px;
  89.     display: inline-block;
  90.     -webkit-border-radius: 38px;
  91.     -moz-border-radius: 38px;
  92.     border-radius: 38px;
  93. }
  94.  
  95. .table-list li:nth-child(2n) {
  96.     background: #F0F0F0;
  97. }
  98.  
  99. .table-buy {
  100.     background: #FFF;
  101.     padding: 15px;
  102.     text-align: left;
  103.     overflow: hidden;
  104. }
  105.  
  106. .table-buy p {
  107.     float: left;
  108.     color: #37353a;
  109.     font-weight: 700;
  110.     font-size: 2.4em;
  111. }
  112.  
  113. .table-buy p sup {
  114.     font-size: 0.5em;
  115.     position: relative;
  116.     left: 5px;
  117. }
  118.  
  119. .table-buy .pricing-action {
  120.     float: right;
  121.     color: #FFF;
  122.     background: #e95846;
  123.     padding: 10px 16px;
  124.     -webkit-border-radius: 2px;
  125.     -moz-border-radius: 2px;
  126.     border-radius: 2px;
  127.     font-weight: 700;
  128.     font-size: 1.4em;
  129.     text-shadow: 0 1px 1px rgba(0,0,0,0.4);
  130.     -webkit-transition: all 0.25s ease;
  131.     -o-transition: all 0.25s ease;
  132.     transition: all 0.25s ease;
  133. }
  134.  
  135. .table-buy .pricing-action:hover {
  136.     background: #cf4f3e;
  137. }
  138.  
  139. .recommended .table-buy .pricing-action:hover {
  140.     background: #228799;
  141. }

最后使用 CSS 媒体查询来兼容各种尺寸的屏幕:

  1. /** ================
  2.  * Responsive
  3.  ===================*/
  4.  @media only screen and (min-width: 768px) and (max-width: 959px) {
  5.     .pricing-wrapper {
  6.         width: 768px;
  7.     }
  8.  
  9.     .pricing-table {
  10.         width: 236px;
  11.     }
  12.  
  13.     .table-list li {
  14.         font-size: 1.3em;
  15.     }
  16.  
  17.  }
  18.  
  19.  @media only screen and (max-width: 767px) {
  20.     .pricing-wrapper {
  21.         width: 420px;
  22.     }
  23.  
  24.     .pricing-table {
  25.         display: block;
  26.         float: none;
  27.         margin: 0 0 20px 0;
  28.         width: 100%;
  29.     }
  30.  }
  31.  
  32. @media only screen and (max-width: 479px) {
  33.     .pricing-wrapper {
  34.         width: 300px;
  35.     }
  36. }

CSS3 超精美实用价格表动画特效

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

演示地址 下载地址
收藏
(0)

发表回复

热销模板

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

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