简体   繁体   English

如何更改活动时的折叠颜色?

[英]How to change collapse color on active?

I would like to change collapse heading color (background and font color): 我想更改折叠标题颜色(背景和字体颜色):

http://jsfiddle.net/KbQyx/ http://jsfiddle.net/KbQyx/

How to make this thing ? 这个东西怎么做?

<div class="panel-group" id="accordion">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h4 class="panel-title">
        <a  data-toggle="collapse" data-parent="#accordion" data-target="#collapseOne">
          Collapsible Group Item #1
        </a>
      </h4>
    </div>
    <div id="collapseOne" class="panel-collapse collapse in">
      <div class="panel-body">
        Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
      </div>
    </div>
  </div>

</div>

I am assuming that data-accordion is only in <h4> tag. 我假设data-accordion仅在<h4>标记中。

Here is a working solution: jsfiddle 这是一个可行的解决方案: jsfiddle

.panel-default > .panel-heading > .panel-title.collapsed > a{
    color: #333;
    background-color: #f5f5f5;
    border-color: #ddd;
  }


 .panel-default > .panel-heading > .panel-title:not(.collapsed) > a{
    color: #fff;
    background-color: red;
    border-color: red;
   }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM