CSS for overriding font size in every text in a Survey | XM Community
Skip to main content
Question

CSS for overriding font size in every text in a Survey

  • January 23, 2025
  • 3 replies
  • 48 views

Forum|alt.badge.img+1
  • Level 1 ●
  • 4 replies

Hi everybody,

naively I copied and paste question and answers from a MS word, and moreover I changed the layout of much of the text and the answers of the question. Now I’d like to override everything by using a CSS that makes every text (questions, answers, choices, everything) as big as 20px.

I have some code but it doesn’t fix some responses, text/graphics entries etc.

.Skin .QuestionText {font-size:25px !important}
.Skin .QuestionBody {font-size:25px !important}
.Skin .AnswerText {font-size:25px !important}
.Skin .AnswerBody {font-size:25px !important}
.Skin .TextGraphicText {font-size:25px !important}

I tried to use the layout mask in Look and Feel but it doesn’t  override rich text changes.

Moreover, some lines of the matrices I have are not considered as ‘question’ or either ‘answer’, The same happens with levels of the likert scales.

Every hint is appreciated.

Thanks alot
 

3 replies

Forum|alt.badge.img+22
  • Level 7 ●●●●●●●
  • 2028 replies
  • January 24, 2025

Add this to your header. It is brute force, so may have some unexpected results:

<script>
	Qualtrics.SurveyEngine.addOnReady(function () {
		document
			.querySelector(".Skin")
			.querySelectorAll("*")
			.forEach((item) => (item.style.fontSize = "25px!"));
	});
</script>

 


Forum|alt.badge.img+1
  • Author
  • Level 1 ●
  • 4 replies
  • January 24, 2025

 

ahmedA wrote:

Add this to your header. It is brute force, so may have some unexpected results:

<script>
	Qualtrics.SurveyEngine.addOnReady(function () {
		document
			.querySelector(".Skin")
			.querySelectorAll("*")
			.forEach((item) => (item.style.fontSize = "25px!"));
	});
</script>

 

Why should it? 

May I ask you what programming language is that, or the documentation on the programmind side of Qualtrics? Because I have no idea

Thanks alot

 

 

 

Edit: Anyway man, unfortunately it doesn’t work


Forum|alt.badge.img+22
  • Level 7 ●●●●●●●
  • 2028 replies
  • January 24, 2025

There’s a typo, please remove the “!” point after px.

 

Regarding your question, its plain JavaScript. Basically, it is selecting everything * and setting its font-size property to “25px”. So there’s no reason it shouldn’t work. 

 

I’m not sure what the objective is, but if you just want things to look bigger, another thing you could try is the scale transform:

Replace style.fontSize = "25px" with style.transform = "scale(2)" 

The number inside the bracket indicates the scaling ratio.


Leave a Reply