How can I change css for one question only? change the surface color of a choice after selecting it? | XM Community
Skip to main content
Solved

How can I change css for one question only? change the surface color of a choice after selecting it?

  • 10 March 2021
  • 1 reply
  • 765 views

I want, only for one specific question of the whole survey, to change the surface color of the choice after selecting the choice. The question type is multiple choice with a single answer. So far the default color after clicking on the choice is purple. I want to change the color to red or blue according to the value of an embedded data in the survey. How can I do it? Thanks a lot for your help!
Screen Shot 2021-03-10 at 10.15.30 PM.pngScreen Shot 2021-03-10 at 10.15.41 PM.png

Each question block has an id selector. Use Developer tools in the browser to find the appropriate selector to add the css to the style in the Layout options for the Survey.
.Skin #QID144 label.MultiAnswer, .Skin #QID144 label.SingleAnswer
{ background:#ffffff;
border-color: #ffffff;
border-width:2px;
color: #ffffff;
font-weight: Bold;
}

Another way would be to use JavaScript to set style again using the question ID.


Leave a Reply