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

Removing Brand Level Code in Individual Questions

  • October 9, 2024
  • 3 replies
  • 43 views

Forum|alt.badge.img+4

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? 

3 replies

Nam Nguyen
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+29
  • QPN Level 8 ●●●●●●●●
  • 1096 replies
  • October 11, 2024

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


Forum|alt.badge.img+4
  • Author
  • Level 2 ●●
  • 7 replies
  • October 15, 2024

@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
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+29
  • QPN Level 8 ●●●●●●●●
  • 1096 replies
  • October 15, 2024

@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