當所有面板摺疊時,背景顏色應爲白色。面板打開時,面板標題背景顏色應爲灰色。我該怎麼做,請嗎?如何在摺疊/摺疊時更改Bootstrap手風琴標題
<div class="panel panel-simple">
<div class="panel-heading" role="tab" id="headingOneMaintenance">
<h4 class="panel-title">
<a class="accordion-toggle" role="button" data-toggle="collapse" data-parent="#accordionMaintenance" href="#collapseOneMaintenance" aria-expanded="true" aria-controls="collapseOneMaintenance">
What will you do to prepare my apartment before I move in?
</a>
</h4>
</div>
<div id="collapseOneMaintenance" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOneMaintenance">
<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>
有了這個CSS,我所有的面板是白色的,但是當面板打開,我想報頭是灰色的:
.panel-heading {
background-color: white;}
它不必雖然是這個CSS。謝謝!
您只顯示一個面板,但問題是:*「當所有面板都摺疊...」*。請將您的示例更新爲重現您問題的示例。否則,您會得到一個適用於此的答案,但不適用於您的網站。 –