-
Bernhard
Hello,
I want to create accordions with synchronized styles and alternating background colors:
1 st item: color 1 rgba(255, 194, 51, 0.05)
2 nd item: color 2 rgba(77, 255, 0, 0.05)
3 rd item: color 1
4 th item: color 2 and so on.
How can I do this? -
Hi there,
You can set different background colours for each accordion item.
-
Bernhard
OK, but then I can’t synchronize the styles. Is it possible to do it with some CSS?
-
Yes, it’s possible, you can create custom selectors for the accordion block.
For example, if you want to target the odd accordion items, then create a selector
>.gb-accordion__item:nth-child(odd).Here’s a screenshot for your reference:
https://app.screencast.com/3yaJtvjNZrKxFIn the example, I’ve created a custom selector for odd accordion items, and changed the background color to purple.
-
Bernhard
Ah, ok, I used still the GB1 version.
Thank you 🙂 -
No Problem 🙂
- You must be logged in to reply to this topic.