IceDawg IceDawg - 4 months ago 10
jQuery Question

How to change content background colour for Jquery Accordion

How to change content background colour for Jquery Accordion? I've tried to change it in CSS and JS file:

[CSS]

.ui-accordion-content {
width: 100%;
background-color: #f3f3f3;
color: #777;
font-size: 10pt;
line-height: 16pt;
}


[JS]

$(".ui-accordion-content").css("background", "#fcfff4")


none of them works.

Answer

To answer: You need to be aware of CSS selector precedence.

You have to use a more specific CSS selector. Read the standard on what takes precedence for browsers choosing which CSS selectors for an element. So something like

#myAccordion .ui-accordion-content

might do it. Or you might have to be more specific.

Here are a few links to more information about this:

Comments