Removing Brand Level Code in Individual Questions | XM Community
Skip to main content

If we put this code at the brand level look and feel 

<style type="text/css">li:last-of-type { border-top: 2px solid #8D8D8D4D; }

li:last-of-type label { margin-top:10px; }

</style>

 

is there code that can be put into the individual questions to remove the line from the questions where it’s not necessary? 

Hi @smilburn, You can add this JS to the question that you want to remove the line

Qualtrics.SurveyEngine.addOnload(function() {
var questionID = this.getQuestionContainer().id;

var lastListItem = document.querySelector('#' + questionID + ' li:last-of-type');

if (lastListItem) {

lastListItem.style.borderTop = 'none';
lastListItem.style.margin = '0';
lastListItem.style.padding = '0';
}

var labels = document.querySelectorAll('#' + questionID + ' label');

labels.forEach(function(label) {
label.style.setProperty('margin-top', '0', 'important');
});
});

Let me know if it work


@Nam Nguyen This worked!! My code is applying to bulleted lists, too, we just want it to apply to questions (not bulleted lists) how can we change to accomplish this? 

li:last-of-type { border-top: 2px solid #8D8D8D4D; } 
li:last-of-type label { margin-top:10px; } 

 


@Nam Nguyen This worked!! My code is applying to bulleted lists, too, we just want it to apply to questions (not bulleted lists) how can we change to accomplish this? 

li:last-of-type { border-top: 2px solid #8D8D8D4D; } 
li:last-of-type label { margin-top:10px; } 

@smilburn The JS also worked with common bullet list in the question text, so I don’t know what’s the problem you are stumbling upon. Please give me a picture or something to show what’s the problem


Leave a Reply