CSS: How to move the div/table without affecting other page | XM Community

CSS: How to move the div/table without affecting other page

  • 26 September 2022
  • 10 replies
  • 145 views

Badge +2

Hello Community,
I'm trying to move one single div in the left and remove the vertical scroll at the bottom without affecting other page divs/table using css
tempsnip.png


10 replies

Userlevel 7
Badge +27

Make the rule specific to the question by adding #QIDxx to it.

Badge +2

Thank you for response TomG, however the div classes and id of all pages are the same is there any way to margin-left the div/container without affecting the other div/container in other pages
image.png

Userlevel 7
Badge +27

Yes, as I said, use the QID in the rule. The rule might be something like:
#QID99 { margin-left: -10px; }
Depending on what other rules apply to the div, you may need to make the rule more specific to trump the other rules.

Badge +2

Thank you for response TomG however I tried this code and still not working this following code:
/* I tried new question with question id (QID5) but same problem I'm trying to move to the left the one div in 1 page and not affecting the other pages in the survey */
.Skin #SkinContent {
  border-radius: 0;
  max-width: 100%;
  min-width: 100%;
}
#QID5 div #SkinContent {
margin-left:-20%;
}

image.pngimage.png

Userlevel 7
Badge +27

Your selector is wrong. #SkinContent isn't a descendant of #QID5.

Badge +2

Hi TomG, sorry I'm new to Qualtrics however what could be the possible unique id for #SkinContent in each pages?

Userlevel 7
Badge +27

IDs (items proceeded by 😵 should always be unique on a page. CSS rules get applied based on specificity (unless overridden with

!important
). So,
.Skin #SkinContent
would take precedence over
#SkinContent
because it is more specific.
All question containers (e.g.,
#QID5
) are descendants of
#SkinContent
so they would come after
#SkinContent
in any rule (e.g.,
#SkinContent #QID5
), but since there aren't default rules any specific questions, you can just use
#QID5
.

Badge +2

Yes TomG, I tried .Skin #SkinContent {margin-left:20%;}(example) however all of the divs in the pages are also moving to the left side of page. I also tried to use #QID5 {margin-left:20%;}(example) however only the SBS question is moving to the left. What I'm trying to work is to move to the side a one single div and not affecting the other divs to the other pages. I just don't know how I will do it

Userlevel 7
Badge +27

It would be helpful if you specify the div you want to change. Try

#QID5 .QuestionBody  {margin-left:-20% !important;}
.

Badge +2

HiTomG, This is what happened to the #QID5 .QuestionBody  {margin-left:-20% !important;}
image.png

Leave a Reply