Welcome to the LimeSurvey Community Forum

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

How to change css for specific questions

  • UnserFranz
  • UnserFranz's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 6 months ago #174285 by UnserFranz
How to change css for specific questions was created by UnserFranz
Hi,

how may I modify the css (eg background-color) for specific questions/question-title-containers, only (or assign different colors to each question)?

I wrote
Code:
.question-title-Wald {
    background-color: #84bb21;
}
in the custom.css, and added the class in the question display options menu, but it doesn't seem to be applied :(
Should it be
Code:
.question-title-container .Wald {
    background-color: #84bb21;
}
?
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 6 months ago #174296 by DenisChenu
Replied by DenisChenu on topic How to change css for specific questions
With manual.limesurvey.org/Question_type_-_Sh...lass_.28css_class.29 ab set class to wald,
You can use
.wald .question-title-container {
background-color: #84bb21;
}

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: UnserFranz
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 6 months ago #174299 by tpartner
Replied by tpartner on topic How to change css for specific questions
If your question CSS class is "Wald", the rule should be something like:

Code:
.Wald .question-title-container {
    background-color: #84bb21;
}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • LouisGac
  • LouisGac's Avatar
  • Visitor
  • Visitor
5 years 6 months ago #174304 by LouisGac
Replied by LouisGac on topic How to change css for specific questions
if you want to modify the CSS of a specific question (not a question type), you can use the question id:

#question356 { ... }
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 6 months ago - 5 years 6 months ago #174306 by tpartner
Replied by tpartner on topic How to change css for specific questions
But...question CSS class is portable between surveys. :)

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 5 years 6 months ago by tpartner.
The following user(s) said Thank You: DenisChenu, LouisGac, UnserFranz
The topic has been locked.
  • UnserFranz
  • UnserFranz's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 6 months ago #174325 by UnserFranz
Replied by UnserFranz on topic How to change css for specific questions
Aaah, quite close then.
You all are just amazing!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose