add background color to form question | XM Community
Skip to main content

Hello

I would like to set a background color for a form question. How can I do that?

Hi @moferro, I once used this CSS code, please try if it works for you as well-

#QuestionID {
    background-color: Colorcode;
    padding: 10px;
}
 

You will need to replace the Question id & color code


@moferro If you do not want to search for the actual question ID, you can also just add this JavaScript to your form question: 

Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
document.getElementById(this.questionId).style.backgroundColor = "#40E0D0";
});

Results in: 

Just replace the color code with your preferred one. 

Best
Christian


Leave a Reply