CSS classes for questions/apply CSS style to some questions only | XM Community
Solved

CSS classes for questions/apply CSS style to some questions only

  • 20 November 2018
  • 4 replies
  • 297 views

Userlevel 5
Badge +6
  • Level 3 ●●●
  • 197 replies
Hello,
I want to change padding using following CSS code. However, I want to apply it to some questions only. Is there some way how to define a CSS class for questions in Qualtrics or to change CSS style in some question only using its ID or something like that?
Thank you very much for any ideas in advance.

.Skin .Separator {
margin:0px 20px;
}
.Skin .QuestionText {
font-size: 100%;
padding: 2px;
}
.Skin .QuestionBody {
padding:0px 1px 0px 1px;
}

.Skin .MC .MAHR .QuestionBody table td span.LabelWrapper label,
.Skin .MC .SAHR .QuestionBody table td span.LabelWrapper label {
padding-bottom: 5px !important;
}
icon

Best answer by Anonymous 20 November 2018, 16:26

View original

4 replies

Hello @fleb ,

We can apply the required CSS on a specific page, using the below code

`jQuery(".Skin .Separator").css({"margin":"0px 20px"});`

And similarly for other codes
Userlevel 5
Badge +6
Hi @Shashi,
thank you very much again. I'm able to solve my problem with this. However is there some way how to do it if I want to apply it only to a subset of question on one page?
Userlevel 7
Badge +27
@fleb,

You can make CSS specific to a page, by adding it in a `<style>` tag to any question text on the page instead of in Look & Feel.

You can make CSS specific to a question by adding the question's id to the rule's selector. For example:
```
#QID1 .QuestionBody { padding:0px 1px 0px 1px; }
```
Userlevel 5
Badge +6
@TomG
Thank you very much.

Leave a Reply