Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Change css/style within a survey ?

Change css/style within a survey ? 3 years 1 month ago #66105

  • muellers
  • muellers's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 18
  • Karma: 0
Hi,

I need to change the layout within a survey. One Question has an extraordinary status in the survey.
How can I change eg. background colour, or better the hole css?

Setting the html bgcolour attribute does not work. Running the survey sets all formatings accordig the css definition.

Any ideas?

Thanks in advance
The administrator has disabled public write access.

Re: Change css/style within a survey ? 3 years 1 month ago #66112

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4360
  • Thank you received: 827
  • Karma: 381
You can make CSS rules question-specific by prepending the selectors with "#questionqID".

So if you want to target a question with question ID 11, something like:
#question11 .questiontext{
	background-color: pink;
}
Cheers,
Tony Partner

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

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Last Edit: 3 years 1 month ago by tpartner.
The administrator has disabled public write access.

Re: Change css/style within a survey ? 3 years 1 month ago #66117

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5423
  • Thank you received: 307
  • Karma: 252
...this code can be added at the main style file of your template which is caled template.css and is located at the /upload/templates/<yourtemplate> folder.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: Change css/style within a survey ? 3 years 1 month ago #66133

  • muellers
  • muellers's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 18
  • Karma: 0
Thanks for the hint.
I'll try that tomorrow.

Do I have to specify Sid and Gid when runnung more than one survey with the same css?

Is there a direct way to do the trick? Eg special command in the html code of the question itself? This would be easier for editing a plenty of surveys..

have a nice weekend!
The administrator has disabled public write access.

Re: Change css/style within a survey ? 3 years 1 month ago #66134

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4360
  • Thank you received: 827
  • Karma: 381
Do I have to specify Sid and Gid when runnung more than one survey with the same css?
No, just the question ID - they are unique.
Is there a direct way to do the trick? Eg special command in the html code of the question itself? This would be easier for editing a plenty of surveys..
If you want to do it in the question HTML you will need to use JavaScript. Something like:
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function(){
 
		$('#question11 .questiontext').css({
			'background-color':'pink',
			'color':'blue'
		}); 
 
	});
 
</script>
Cheers,
Tony Partner

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

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Change css/style within a survey ? 3 years 1 month ago #66191

  • muellers
  • muellers's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 18
  • Karma: 0
well the script works after changing .questiontext in .be Don't know why somebody changed so many settings in our template.

But one needed feature is left:
On this special question (now with contrasting colour :-)
is it possible to change the logo (which is defind in the "survey.pstpl") the same way?

Have a nice day.
The administrator has disabled public write access.

Re: Change css/style within a survey ? 3 years 1 month ago #66197

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5423
  • Thank you received: 307
  • Karma: 252
Sure you can change that. At the template editor delete the existing log (mostly called "logo.png") and replace it with your logo which has also be named "logo.png". You can upload your logo using the template editor.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: Change css/style within a survey ? 3 years 1 month ago #66224

  • muellers
  • muellers's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 18
  • Karma: 0
I need to do the Logo change for only ONE special question in a longer survey. All other questions follow the standard scheme.
The administrator has disabled public write access.

Re: Change css/style within a survey ? 3 years 1 month ago #66226

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4360
  • Thank you received: 827
  • Karma: 381
In that case, you will need to use JavaScripr to change the src attribute of the image. The script would depend on your template. Can you show us a sample survey.
Cheers,
Tony Partner

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

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Change css/style within a survey ? 3 years 1 month ago #66233

  • muellers
  • muellers's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 18
  • Karma: 0
the logo is set up in the survey.pstpl with standard <img> tag. the hole content of the file is in my office...
what do you need exactly?
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.138 seconds
Donation Image