- Posts: 10109
- Thank you received: 3595
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
How can I change the background color for an individual question block?
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
6 years 10 months ago #156091
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic How can I change the background color for an individual question block?
See here for info on inserting JavaScript -
manual.limesurvey.org/Workarounds:_Manip...tc..29_in_LimeSurvey
Ben;s script will add a style rule to the <head> section but if you want to add a class to the question as in the above workaround, insert this script into the question text (don't modify anything except "header-red"):
Then, if using the default template, you can insert something like this at the end of template.css:
Ben;s script will add a style rule to the <head> section but if you want to add a class to the question as in the above workaround, insert this script into the question text (don't modify anything except "header-red"):
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { $('#question{QID}').addClass('header-red'); }); </script>
Then, if using the default template, you can insert something like this at the end of template.css:
Code:
.header-red td.questiontext { background-color: #FF0000; }
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- maxersloan
- Offline
- Senior Member
Less
More
- Posts: 60
- Thank you received: 1
6 years 10 months ago #156128
by maxersloan
Replied by maxersloan on topic How can I change the background color for an individual question block?
Thanks Tony. Works great with the default template. I'll have to play around with my real template to see how I can implement your solution.
Thanks again!
Thanks again!
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
6 years 10 months ago - 6 years 10 months ago #156135
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic How can I change the background color for an individual question block?
If you get stuck, post a link here to a live sample survey using that template and we'll tune the CSS selectors.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 6 years 10 months ago by tpartner.
The topic has been locked.