I’m trying to add a different background to each accordion title box (one for active, a different one for inactive). I figured out how to do this via CSS for all of them at once but can’t find a way to target each one separately.
For example, I have 4 title boxes: I want box 1 to have a blue inactive background, box 2 to have a red inactive background, box 3 to have a yellow inactive background, and box 4 to have purple background.
I appreciate any assistance.
Hey m_roventine,
Please try adding this code to the Quick CSS section under Enfold > General Styling or to your child themes style.css file:
nth-child(x) where x is the number of the tab if you have more tabs please add more blocks of css to match the number of tabs.
/* Accordion Tabs Color*/
.av_toggle_section:nth-child(1) .toggler, .av_toggle_section:nth-child(1) .toggler{
background: red!important;
}
.av_toggle_section:nth-child(2) .toggler, .av_toggle_section:nth-child(2) .toggler {
background: gold!important;
}
.av_toggle_section:nth-child(3) .toggler, .av_toggle_section:nth-child(3) .toggler {
background: green!important;
}
/* Accordion Tabs Color on hover*/
.av_toggle_section:nth-child(1) .toggler, .av_toggle_section:nth-child(1) .toggler:hover {
background: pink!important;
}
.av_toggle_section:nth-child(2) .toggler, .av_toggle_section:nth-child(2) .toggler:hover {
background: black!important;
}
.av_toggle_section:nth-child(3) .toggler, .av_toggle_section:nth-child(3) .toggler:hover {
background: gray!important;
}
Best regards,
Vinay
That works perfectly! Thank you.