Does anyone know how to center text-entry boxes? | XM Community
Skip to main content
Solved

Does anyone know how to center text-entry boxes?

  • December 14, 2017
  • 4 replies
  • 1311 views

mcoverdale
Level 2 ●●
Forum|alt.badge.img+3
Is there a way to make the text-entry boxes appear in the center of the screen rather than the left side?

Best answer by AnthonyR

Assuming you are using a Text entry style question, add the following to the html of the question: <style> .ChoiceStructure { text-align: center; } </style> If you have multiple questions on the page and you only want to center this one, try adding the following Javascript to the Question: Qualtrics.SurveyEngine.addOnReady(function() { this.questionContainer.select('.ChoiceStructure')[0].style = 'text-align: center;'; });

4 replies

AnthonyR
Level 4 ●●●●
Forum|alt.badge.img+7
  • Level 4 ●●●●
  • 308 replies
  • Answer
  • December 14, 2017
Assuming you are using a Text entry style question, add the following to the html of the question: <style> .ChoiceStructure { text-align: center; } </style> If you have multiple questions on the page and you only want to center this one, try adding the following Javascript to the Question: Qualtrics.SurveyEngine.addOnReady(function() { this.questionContainer.select('.ChoiceStructure')[0].style = 'text-align: center;'; });

mcoverdale
Level 2 ●●
Forum|alt.badge.img+3
  • Author
  • Level 2 ●●
  • 17 replies
  • December 14, 2017
@AnthonyR The html worked perfectly! Thank you!

LibertyW
Level 3 ●●●
Forum|alt.badge.img+5
  • Level 3 ●●●
  • 95 replies
  • January 29, 2018
@AnthonyR - thanks for posting! All sorts of useful snippets for us Qubies 0_o

kgillis
Level 6 ●●●●●●
Forum|alt.badge.img+30
  • Level 6 ●●●●●●
  • 144 replies
  • June 20, 2025

@AnthonyR , ​@LibertyW can either of you show me exactly where I should place this? I’ve tried placing it between the brown //, I’ve removed everything and added in “<style> .ChoiceStructure { text-align: center; } </style>,” I’ve tried only adding it on one of the lines… The above screenshot is what pulls up when I open up JS on the question