手风琴

bootstrap手风琴菜单

阿里云


这是一款 bootstrap 手风琴菜单美化效果。该 bootstrap 手风琴菜单在原生 bootstrap accordion 的基础上,通过简单的 CSS 代码来进行美化,生成更加漂亮的 bootstrap 手风琴菜单效果。

使用方法:

在页面中引入 jquery 和 bootstrap 相关文件,以及 font-awesome 字体图标文件。

也想出现在这里?联系我们
创客主机
  1. <link href="path/to/css/bootstrap.min.css" rel="stylesheet">
  2. <link href="path/to/css/font-awesome.min.css" rel="stylesheet">
  3. <script src="path/to/js/bootstrap.min.js"></script>
  4. <script src="path/to/js/bootstrap.min.js"></script>

HTML 结构:

该 bootstrap 手风琴菜单的基本 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>手风琴内容1</p>
  16.                         </div>
  17.                     </div>
  18.                 </div>
  19.  
  20.                 <div class="panel panel-default">
  21.                     <div class="panel-heading" role="tab" id="headingTwo">
  22.                         <h4 class="panel-title">
  23.                             <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
  24.                                 Section 2
  25.                             </a>
  26.                         </h4>
  27.                     </div>
  28.                     <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
  29.                         <div class="panel-body">
  30.                             <p>手风琴内容2</p>
  31.                         </div>
  32.                     </div>
  33.                 </div>
  34.  
  35.                 <div class="panel panel-default">
  36.                     <div class="panel-heading" role="tab" id="headingThree">
  37.                         <h4 class="panel-title">
  38.                             <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
  39.                                 Section 3
  40.                             </a>
  41.                         </h4>
  42.                     </div>
  43.                     <div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree">
  44.                         <div class="panel-body">
  45.                             <p>手风琴内容3 </p>
  46.                         </div>
  47.                     </div>
  48.                 </div>
  49.             </div>
  50.         </div>
  51.     </div>
  52. </div>

CSS 样式:

为该 bootstrap 手风琴菜单添加下面的 CSS 样式,来对其进行美化。

  1. a:hover,a:focus{
  2.     text-decoration: none;
  3.     outline: none;
  4. }
  5. #accordion .panel{
  6.     border: none;
  7.     box-shadow: none;
  8.     border-radius: 10px;
  9.     margin-bottom: 10px;
  10. }
  11. #accordion .panel-heading{
  12.     padding: 0;
  13.     border: none;
  14.     border-radius: 10px;
  15. }
  16. #accordion .panel-title a{
  17.     display: block;
  18.     padding: 20px 35px;
  19.     font-size: 20px;
  20.     font-weight: 600;
  21.     color: #fff;
  22.     background: #888bc2;
  23.     border: none;
  24.     position: relative;
  25.     transition: all 0.3s ease 0s;
  26. }
  27. #accordion .panel-title a:after,
  28. #accordion .panel-title a.collapsed:after{
  29.     content: "\f068";
  30.     font-family: fontawesome;
  31.     width: 40px;
  32.     height: 40px;
  33.     line-height: 32px;
  34.     border-radius: 50%;
  35.     background: #888bc2;
  36.     text-align: center;
  37.     font-size: 15px;
  38.     color:#fff;
  39.     border: 5px solid #fff;
  40.     position: absolute;
  41.     top: 10px;
  42.     left: -20px;
  43.     transition: all 0.3s ease 0s;
  44. }
  45. #accordion .panel-title a.collapsed:after{
  46.     content: "\f067";
  47. }
  48. #accordion .panel-title a:hover:after,
  49. #accordion .panel-title a.collapsed:hover:after{
  50.     transform: rotate(360deg);
  51. }
  52. #accordion .panel-body{
  53.     padding: 15px 25px;
  54.     background: #fff;
  55.     font-size: 14px;
  56.     color: #8c8c8c;
  57.     line-height: 25px;
  58.     border-top: none;
  59.     position: relative;
  60. }

bootstrap 手风琴菜单

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

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

发表回复

热销模板

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

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