Changing background color for single block | XM Community
Skip to main content
Solved

Changing background color for single block

  • July 9, 2020
  • 2 replies
  • 766 views

Hello everyone,
unfortunately I am struggeling to change the background color for a whole block.
Changing the background color for the whole survey or single 'descriptive text' is no problem but not for the whole block.
The idea behind my question: I am asking the same questions for different areas of life. The color-scheme may help participants.



Best answer by rondev

Use the below code that changes the background of a page:
jQuery("#Questions").css("background-color","skyblue");
So if their are five pages in a block, you need to paste the code five times, i.e. paste the code on any one question of the page.

2 replies

rondev
Level 6 ●●●●●●
Forum|alt.badge.img+22
  • Level 6 ●●●●●●
  • Answer
  • July 9, 2020

Use the below code that changes the background of a page:
jQuery("#Questions").css("background-color","skyblue");
So if their are five pages in a block, you need to paste the code five times, i.e. paste the code on any one question of the page.


  • Author
  • July 9, 2020

Perfect!
My "workaround" is this:

jQuery("#"+this.questionId+" .QuestionText").css("background","#0972CD");
jQuery("#"+this.questionId+" .QuestionBody").css("background","#BEDEFC");


Your code is way better!