CSS in Wiki Pages

CSS in Wiki Pages

by Daniel Duenner -
Number of replies: 1
Hi

I'm using moodle 3.1 and was wondering if I can add an inline stylesheet to a wiki page in moodle?
For example I want to add this code on a wiki page:

<style>
body {background-color: powderblue;}
h1   {color: blue;}
p    {color: red;}
</style>

Moodle cuts it out when I save. Is there a way to make it stay in my entry?

Thanks for your help.


Average of ratings: -
In reply to Daniel Duenner

Re: CSS in Wiki Pages

by Jon Bolton -
Picture of Particularly helpful Moodlers Picture of Testers

You can add this to your custom css if you have access, eg

body#page-mod-wiki-view {background: PowderBlue;}
#page-mod-wiki-view h1 {color: blue;}


You can even target individual wikis, eg.

body.cmid-78 {background: PowderBlue;}
.cmid-78 h1 {color: blue;}
.cmid-78 p {color: red;}


or, you could add it inline in the wiki page if you really have to:

<h1 style="color: blue;">headingtext </h1>
Average of ratings: Useful (2)