General developer forum

Different css styles for different courses/pages

 
Picture of César Augusto Ojeda
Different css styles for different courses/pages
 

Hi!


I'm new at Moodle, I've worked with a different LMS before and now we're switching to Moodle.

My question is if I can have different css stylesheets for different courses.

We hold our css files online on our own server so I connect them to Moodle by accessing the site administration > appearance > additional HTML and adding the links on there but is there a way to link css stylesheets to specific courses?

When I link them through the additional HTML tool the css gets used thorough all our files and we need specific css to specific courses. 

That way i can use different colours, fonts, etc. depending on the course.


Thanks! any help is greatly appreciated!

 
Average of ratings: -
Picture of Marcus Green
Re: Different css styles for different courses/pages
Core developersParticularly helpful MoodlersPlugin developersTesters

I am not sure if it would help, but it is possible to have different themes for different courses.

 
Average of ratings: Useful (1)
Gareth J Barnard
Re: Different css styles for different courses/pages
Core developersParticularly helpful MoodlersPlugin developers

You can specify a theme on a per course basis: Theme_settings#Allow_course_themes.

 
Average of ratings: Useful (1)
Picture of Richard Oelmann
Re: Different css styles for different courses/pages
Core developersParticularly helpful MoodlersPlugin developersTesters

As well as Marcus and Gareth's responses, you can also target css based on the course-id in the body classes.

 
Average of ratings: Useful (1)