CSS you could use to display question blocks horizontally | XM Community

CSS you could use to display question blocks horizontally

  • 27 June 2019
  • 1 reply
  • 28 views

Userlevel 5
Badge +13
Why would I want a horizontal layout for survey questions? The use-case I have for a horizontal layout involves comparing sets of images side by side.

The following isn't perfect but if you are trying to lay your questions out horizontally (not related to horizontal answers), below is some CSS to get you started. I know, you aren't suppose to use !important in your CSS, but that was the only way I could override the default CSS.

/* this is the parent of the question blocks */
#SkinContent {
vertical-align: top;
white-space:nowrap !important;
overflow:scroll !important;
position:fixed !important;
top:0px;left:0px;
border:1px solid #000;
}

/* these are the question 'wrappers' that we want to lay horizontally across the screen */
.QuestionOuter {
vertical-align: top; /* align the text of the question blocks to the top (otherwise they will sit at the bottom) */
display:inline-block !important;
}

/* we need to do away with the question separators */
.Separator {display:none !important;}

/* question wrappers */
#Questions {
overflow:scroll !important; /* we need the horizontal scrollbar */
width:100vw; /* set the width of the workspace to 100% of the browser width */
padding:0px;margin:0px;}

1 reply

Hi all,

Is it possible to adapt this code such that the questions are displayed in the following positions?
survey_questionPosition.jpg
The block would only consist of these 4 questions. Does anybody have an idea?

Thanks a lot!

best wishes,
Laurenz

Leave a Reply