How to reduce space between questions just for a single block? | XM Community
Skip to main content

Pretty much what the title says. I have a block with 15 slider questions and I would like to reduce spacing between questions as possible.

 

Thank you

@QualtricsDude The sliders have some padding on the bottom: 

The standard padding is defined with important which means it’s hard to overrule.

We need to define the style more specific. I used this JavaScript code for each slider that should not have any outer padding or margin. 

Qualtrics.SurveyEngine.addOnReady(function()
{
var qid = this.questionId;
var styleSheet = document.styleSheetsh0];
styleSheet.insertRule('.Skin #SkinContent #Questions .QuestionOuter#' + qid + ' { padding-top: 0 !important; padding-bottom: 0 !important; margin-top: 0 !important; margin-bottom: 0 !important; }', styleSheet.cssRules.length);
});

You can add it to every slider that should not have any margin or padding. If you want to have some but a smaller one, you can adjust the values of the style class from 0 to some low value (lower than standard 1rem for padding-bottom). 

I tested with “Classic” layout. If it does not work for you, that might be the reason. Let me know which layout you are using then. 

Best
Christian


Leave a Reply