Remove extra spacing using Java | XM Community
Skip to main content
Solved

Remove extra spacing using Java

  • February 20, 2018
  • 3 replies
  • 69 views

Akdashboard
Level 4 ●●●●
Forum|alt.badge.img+6
I am not very Java-savvy, but I know I can remove the extra space between questions by adding JavaScript to the question. I haven't done it for a while and cannot remember how. The example I am working on is having "blank" question text for a couple of question types below a descriptive text box. I'd like only the answerable parts to be closer to the descriptive text, instead of huge blank spaces between them.

Best answer by TomG

You can put CSS inside a `<style>` tag as part of a question's text and it will only apply to that page. Anyway, if you want to hide the Separators and the Question text for all but the first: ``` jQuery('.Separator').hide(); jQuery('.QuestionText').each(function(index) { if(index > 0) jQuery(this).hide(); }); ```
View original

3 replies

JulieT
Level 3 ●●●
Forum|alt.badge.img+10
  • Level 3 ●●●
  • 61 replies
  • February 20, 2018
This was actually discussed in a previous thread with @AlexB providing the following code: You can add this CSS into the Look & Feel (adjusting the last number in padding for the amount of space you want): .Skin .QuestionText { padding: 0 0 0px; }

Akdashboard
Level 4 ●●●●
Forum|alt.badge.img+6
  • Author
  • Level 4 ●●●●
  • 488 replies
  • February 20, 2018
That is CSS that would apply to the whole theme. I know it has something to do with QID#. I will comb through the threads again, maybe I missed it.

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5923 replies
  • Answer
  • February 20, 2018
You can put CSS inside a `<style>` tag as part of a question's text and it will only apply to that page. Anyway, if you want to hide the Separators and the Question text for all but the first: ``` jQuery('.Separator').hide(); jQuery('.QuestionText').each(function(index) { if(index > 0) jQuery(this).hide(); }); ```

Leave a Reply