Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

two bootstrap buttons display in a line (single choice)

  • modernity4r
  • modernity4r's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
6 months 6 days ago #251375 by modernity4r
Please help us help you and fill where relevant:
Your LimeSurvey version: limesurvey cloud(6.3) / self-hosted(6.2.9_230925)
Own server or LimeSurvey hosting: Both
Survey theme/template:  Fruity/Vanilla
==================I am using the bootstrap button with the single choice feature to design a list of questions. It involves choosing one out of two types of lists repeatedly.Ideally, the two buttons should appear side by side on a single line, especially for better mobile responsiveness. However, they display on two separate lines on mobile, making the list elongated on smaller screens. This issue also occurs on PCs when adjusting the browser size. On larger displays, they do appear side by side as intended. If there's a recommended approach to ensure they appear on one line, I'd appreciate the suggestion.

Please Log in to join the conversation.

More
6 months 4 days ago #251398 by mfavetti
You can just extend the survey theme you're using and modify the css.
The following user(s) said Thank You: modernity4r

Please Log in to join the conversation.

  • modernity4r
  • modernity4r's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
6 months 1 day ago #251560 by modernity4r
Should I add it to custom.css using the theme editor? Or, should I edit the css under question edit > display > css?

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 months 1 day ago #251563 by tpartner
CSS rules should be in the custom.css file. The question setting is for CSS class names, not rules.

- manual.limesurvey.org/Question_type_-_Sh...lass_.28css_class.29

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 months 22 hours ago #251565 by tpartner
...to add to this...

I would assign a CSS class something like "columns-2" to the question and then add something like this to your custom.css file:

Code:
@media (max-width: 768px) {
 
  .columns-2 .answer-container > .container-fluid  {
    padding: 0 8px;
  }
 
  .columns-2 .radio-list .bootstrap-buttons-div {
    padding: 0 calc(var(--bs-gutter-x)*.25);
    width: 50%;
  }
 
  .columns-2 .radio-list .bootstrap-buttons-div > div {
    padding: 0;
  }
}

 

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu, modernity4r

Please Log in to join the conversation.

  • modernity4r
  • modernity4r's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
6 months 3 hours ago #251591 by modernity4r
Thank you. I will make good use of it. I found and modified the column naming style of the button box through Chrome browser's Developer Tools, and it applies well.

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose