Bootstrap手风琴改变默认颜色

时间:2016-10-04 00:17:55

标签: css twitter-bootstrap

我正在尝试更改Bootstrap中Accordion的默认颜色。我设法令人满意地改变了几乎所有东西(标题,身体等),但我仍然坚持在标题和正文之间看起来像边界(但我不确定)。我尝试了以下解决方案:

  1. this page
  2. Stack... Question 1
  3. Stack.. Question 2
  4. (而且他们已经非常有助于我到达现在的位置,谢谢!)但是我还没有设法深入了解。

    我的HTML如下;

    <div class="container content" id="faq">
        <h2>FAQ</h2>
        <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" href="#collapseTwo">
                            ...
                        </a>
                    </h4>
                </div>
                <div id="collapseTwo" class="panel-collapse collapse">
                    <div class="panel-body">
                        ...
                    </div>
                </div>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <a data-toggle="collapse" data-parent="#accordion" href="#collapseThree">
                            ...
                        </a>
                    </h4>
                </div>
                <div id="collapseThree" class="panel-collapse collapse">
                    <div class="panel-body">
                        ... 
                    </div>
                </div>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <a data-toggle="collapse" data-parent="#accordion" href="#collapseFour">
                            ...
                        </a>
                    </h4>
                </div>
                <div id="collapseFour" class="panel-collapse collapse">
                    <div class="panel-body">
                       ...
                    </div>
                </div>
            </div>
        </div><!--end #accordion -->
    </div><!--end .container #faq-->
    

    我尝试了以下CSS;

    .container >.panel-group >.panel-default {
    border: 0; !important;}
    
    .container >.panel-group >.panel-default >.panel-heading {
    background-color: #27ae60; !important;
    border: 0; !important;}
    
    .panel {
    background-color: #2ecc71;
    border: 5px solid #27ae60;}
    

    我不确定我缺少什么,感谢任何帮助,谢谢。

0 个答案:

没有答案