Reducing space between radio buttons in matrix and horizontal multi select questions | XM Community
Skip to main content

Reducing space between radio buttons in matrix and horizontal multi select questions

  • November 6, 2022
  • 8 replies
  • 304 views

Forum|alt.badge.img+4

Hey!
I'm trying to minimize the spacing between the choices radio buttons in a matrix question and horizontal multi choice question.
Which custom code can be used for that?

Thanks!!

8 replies

Deepak
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+46
  • 1555 replies
  • November 6, 2022

Alina_shaulov
Can you include a picture of which space you're trying to reduce ?
Presuming it's matrix at the top and multi-select at the bottom try using the below by replacing Question ID. Include the below code in CustomCSS> Look and Feel.
 .Skin .QuestionOuter.BorderColor.Matrix.mf.QID18 {
    padding-bottom: 0vh;
}
Hope it helps!


Forum|alt.badge.img+4
  • Author
  • 4 replies
  • November 6, 2022

Sure.
I have these two question types. I'd like to make them as compact a possible, so I'm interested in reducing the space between the answers themselves (meaning having the radio buttons closer to each other) and also minimizing the hight and width of the question.
My purpose is to fit those questions horizontally inside the creative of a pop up survey.
Thanks in advance :)
Screen Shot 2022-11-06 at 14.02.39.pngScreen Shot 2022-11-06 at 14.03.09.png


Deepak
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+46
  • 1555 replies
  • November 6, 2022

Alina_shaulov
For the matrix question I would recommend adding labels instead of adding it in the statement things like (Not Satisfied, Very Satisfied etc.)
Something like this:
image.pngAlso, changing the look and feel settings to Compact
image.pngLastly, add the below code within Custom CSS-> Look n Feel. You can change the % as required.
.Skin .QuestionBody table.ChoiceStructure {
    width: 70% !important;
}
Preview:
image.png
Hope it helps!


Forum|alt.badge.img+4
  • Author
  • 4 replies
  • November 6, 2022

Thanks ! that's very helpful!
Is there also a code I can use to "shrink" the hight of the question?
For example, this is how each statement's of the matrix rating looks like when I test the survey pop up, and I'd like the answers to be presented horizontally instead of vertically.

Thanks again :)
Screen Shot 2022-11-06 at 17.09.36.png


Deepak
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+46
  • 1555 replies
  • November 6, 2022

Alina_shaulov
Where are you testing it specifically in mobile? As on the desktop it looks fine.
You can disable mobile friendly option if you are facing issues in that manner.
Also in the same css you can include height as well along with width.
P. S: You have tagged wrong deepak.
Hope it helps!


Forum|alt.badge.img+4
  • Author
  • 4 replies
  • November 7, 2022

Thanks!!
Do you maybe know if I can somehow change width/height of each statement individually in a matrix question?


Deepak
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+46
  • 1555 replies
  • November 7, 2022

Alina_shaulov
You can change the width and height for all the statements with the below code in custom CSS
span.LabelWrapper label>span {
height: 50px;
width: max-content; /*Can mention in % as well*/
}
You can do the same via javascript for a particular question.
Qualtrics.SurveyEngine.addOnload(function()
{
jQuery('#QID18').find('span.LabelWrapper.table').css({'width':'max-content','height':'50px'});
});
To change for each statement you can use the below code.
Qualtrics.SurveyEngine.addOnload(function()
{
document.getElementById('QID18').querySelectorAll('span.LabelWrapper.table')[0].style.width='max-content';
document.getElementById('QID18').querySelectorAll('span.LabelWrapper.table')[0].style.height='50px'
});
change the [0] to 1,2,3.. as required on different statements. Also change the QID as per your question.
Hope it helps!


Forum|alt.badge.img+4
  • Author
  • 4 replies
  • November 7, 2022

Thanks very much!!