手风琴

Bootstrap漂亮的垂直手风琴列表效果

阿里云


这是一款基于 Bootstrap 的漂亮垂直手风琴列表效果。该垂直手风琴列表代码简单,样式新颖,值得推荐。

使用方法:

在页面中引入 bootstrap 相关文件。

也想出现在这里?联系我们
创客主机
  1. <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
  2. <script src="path/to/jquery.min.js"></script>
  3. <script src="http://cdn.bootcss.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>

HTML 结构:

该垂直手风琴列表的基本 HTML 结构如下。

  1. <div class="container">
  2.     <div class="row">
  3.         <div class="col-md-offset-3 col-md-6">
  4.             <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
  5.                 <div class="panel panel-default">
  6.                     <div class="panel-heading" role="tab" id="headingOne">
  7.                         <h4 class="panel-title">
  8.                             <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
  9.                                 Section 1
  10.                             </a>
  11.                         </h4>
  12.                     </div>
  13.                     <div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
  14.                         <div class="panel-body">
  15.                             <p>.... </p>
  16.                         </div>
  17.                     </div>
  18.                 </div>
  19.                 <div class="panel panel-default">
  20.                     <div class="panel-heading" role="tab" id="headingTwo">
  21.                         <h4 class="panel-title">
  22.                             <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
  23.                                 Section 2
  24.                             </a>
  25.                         </h4>
  26.                     </div>
  27.                     <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
  28.                         <div class="panel-body">
  29.                             <p>...</p>
  30.                         </div>
  31.                     </div>
  32.                 </div>
  33.                 <div class="panel panel-default">
  34.                     <div class="panel-heading" role="tab" id="headingThree">
  35.                         <h4 class="panel-title">
  36.                             <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
  37.                                 Section 3
  38.                             </a>
  39.                         </h4>
  40.                     </div>
  41.                     <div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree">
  42.                         <div class="panel-body">
  43.                             <p>.... </p>
  44.                         </div>
  45.                     </div>
  46.                 </div>
  47.             </div>
  48.         </div>
  49.     </div>
  50. </div>

CSS 样式:

该垂直手风琴列表的 css 样式如下:

  1. a:hover,a:focus{
  2.     text-decoration: none;
  3.     outline: none;
  4. }
  5. #accordion{
  6.     padding-right: 24px;
  7.     padding-left: 24px;
  8.     z-index: 1;
  9. }
  10. #accordion .panel{
  11.     border: none;
  12.     box-shadow: none;
  13. }
  14. #accordion .panel-heading{
  15.     padding: 0;
  16.     border-radius: 0;
  17.     border: none;
  18. }
  19. #accordion .panel-title{
  20.     padding: 0;
  21. }
  22. #accordion .panel-title a{
  23.     display: block;
  24.     font-size: 16px;
  25.     font-weight: bold;
  26.     background: #e16b47;
  27.     color: #f7c59f;
  28.     padding: 15px 25px;
  29.     position: relative;
  30.     margin-left: -24px;
  31.     transition: all 0.3s ease 0s;
  32. }
  33. #accordion .panel-title a.collapsed{
  34.     background: #f7c59f;
  35.     color: #e16b47;
  36.     margin-left: 0;
  37.     transition: all 0.3s ease 0s;
  38. }
  39. #accordion .panel-title a:before{
  40.     content: "";
  41.     border-left: 24px solid #e16b47;
  42.     border-top: 24px solid transparent;
  43.     border-bottom: 24px solid transparent;
  44.     position: absolute;
  45.     top: 0;
  46.     right: -24px;
  47.     transition: all 0.3s ease 0s;
  48. }
  49. #accordion .panel-title a.collapsed:before{
  50.     border-left-color: #f7c59f;
  51. }
  52. #accordion .panel-title a:after{
  53.     content: "\f106";
  54.     font-family: 'FontAwesome';
  55.     position: absolute;
  56.     top: 30%;
  57.     right: 15px;
  58.     font-size: 18px;
  59.     color: #f7c59f;
  60. }
  61. #accordion .panel-title a.collapsed:after{
  62.     content: "\f107";
  63.     color: #e16b47;
  64. }
  65. #accordion .panel-collapse{
  66.     position: relative;
  67. }
  68. #accordion .panel-collapse.in:before{
  69.     content: "";
  70.     border-right: 24px solid #f7c59f;
  71.     border-bottom: 18px solid transparent;
  72.     position: absolute;
  73.     top: 0;
  74.     left: -24px;
  75. }
  76. #accordion .panel-body{
  77.     font-size: 14px;
  78.     color: #333;
  79.     background: #e4e4e4;
  80.     border-top: none;
  81.     z-index: 1;
  82. }

Bootstrap 漂亮的垂直手风琴列表效果

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

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

发表回复

热销模板

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

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