How to style mulitiple bootstrap accordions on one page

I have the accordions working just as i like but i want them in two different colors. I am using the bootstrap 3 code and have created a new css for the main classes. I tried to copy the css and add the additional class but when i do it doesnt work or screws up the layout on the page. any help would be appreciated

.doctor p {
  font-size: .8em;

.doctor img {
  width: 100%;

.doctor .panel-default>.panel-heading{
   background-color: #95deae;
  /*background-image: linear-gradient(to bottom, #95deae, #49a5bf);*/
.doctor .panel-heading .accordion-toggle:after {
    /* symbol for "opening" panels */
    font-family: 'Glyphicons Halflings';  /* essential for enabling glyphicon */
    content: "\e114";    /* adjust as needed, taken from bootstrap.css */
    float: right;        /* adjust as needed */
    color: grey;         /* adjust as needed */
.doctor .panel-heading .accordion-toggle.collapsed:after {
    /* symbol for "collapsed" panels */
    content: "\e080";    /* adjust as needed, taken from bootstrap.css */
.doctor .panel{
    border: none transparent;
    -webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);
    box-shadow:0 1px 1px rgba(0,0,0,.05)
.doctor .panel-body{
	/*background-color: #E4D29D;*/
    background-image:  linear-gradient(to bottom, rgba(246,230,180,1) 0%, rgba(134,199,156,1) 0%, rgba(149,222,174,1) 100%);
.doctor .panel-heading{
    padding:10px 15px;
    border-bottom:none transparent;
.doctor .panel-heading>.dropdown .dropdown-toggle{
.doctor .panel h3 {
  font-weight: 600;
  font-size: 1.2em;
  color: #6F4E36;
  padding-bottom: 5px;
.doctor .panel-title{
.doctor .panel-title>a{
.doctor .panel-footer{
    padding:10px 15px;
    border-top: none ;

Open in new window

Dorinda ReyesSharePoint Developer/SharePoint Migration ExpertAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Juana VillaFront-end DeveloperCommented:
It is hard to tell without seeing the html or a live example.

My guess is that:
1.  You need to add more css to override the code inherited by the original bootstrap styles.
2. Make sure you place the new css after the original bootstrap styles (that way we can override them)
3. Make sure your selector is specific enough to override the inherited styles. Sometimes by adding the type of selector and its name helps. Example: .doctor .panel-title vs .panel-title (the second one will override the first one)
greetings  Dorinda Reyes, , , , In order to get separate accordion panel-collapse panels with different backgrounds, you can use the panel-collapse   ID   in the CSS

if you have two panels like -
    <div id="panel1" class="panel-collapse collapse in">
    <div id="panel2" class="panel-collapse collapse in">

you can use CSS like -

    #panel1 {background-image: linear-gradient(to bottom, #95deae, #49a5bf);}

    #panel2 {background: green;}


Open in new window

Julian HansenCommented:
If you look at an example panel from an accordion (taken from the Bootstrap Javascript page)
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
  <div class="panel panel-default">
    <div class="panel-heading" role="tab" id="headingOne">
      <h4 class="panel-title">
        <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
          Collapsible Group Item #1

Open in new window

You will see this
  <div class="panel panel-default">

Open in new window

The panel-default is what gives the style to the heading and panel. You can change that
For example
  <div class="panel panel-primary">

Open in new window

Will change the heading bars to blue as shown in this example

You can create your own panel-custom style by creating the following styles (taken from the Bootstrap CSS file
  border-color: #337ab7;
.panel-custom > .panel-heading {
  color: #fff;
  background-color: #337ab7;
  border-color: #337ab7;
.panel-custom > .panel-heading + .panel-collapse > .panel-body {
  border-top-color: #337ab7;
.panel-custom > .panel-heading .badge {
  color: #337ab7;
  background-color: #fff;
.panel-custom> .panel-footer + .panel-collapse > .panel-body {
  border-bottom-color: #337ab7;

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
this question has been inactive for 14 days and must be closed, points divided between experts
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.