Alternating Slider Answer Colors | XM Community
Skip to main content

Hello there!
I am trying to add alternating grey and white backgrounds to my slider answer options. I found this existing community question relating to matrix tables, and I was wondering if there was a way to edit the CSS to make this work for the slider question option within the platform. When asking a question with multiple measures, the lack of alternating colors makes the answers hard to differentiate from each other. Any help would be greatly appreciated!! I have attached an image of how the slider questions currently look. I would like to add alternating grey/white background color within each different answer option.
User:

You can use the following code to set a different background colour for alternate choices:
sc = document.querySelectorAll(".slider-container:nth-child(odd)");
sc.forEach(item => item.style.backgroundColor = "#cccccc");
Or you could also add the same thing to CSS.


Ahmed, this work perfectly! Thank you so much!!


Leave a Reply