Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change background of TinyMCE?

I have just install TinyMCE editor for my website. But the default background is black and text colour is gray. Anybody can tell me how to change background to white and text colour to black.

like image 963
asedra_le Avatar asked Sep 12 '09 05:09

asedra_le


People also ask

How do you change the color of your TinyMCE?

To change the default font family, size, or color in the TinyMCE editor, we recommend using content_css or content_style (or a combination of both) depending on your use case. TinyMCE is shipped with a default CSS that determines what the font and everything else looks like in the editor itself.

How do you edit HTML in TinyMCE?

Cloud based integration – Add the TinyMCE CDN link to your index. html or similar file, and set up a TinyMCE initialization script. Self-Hosted alongside your application – Download the TinyMCE zip file, and unzip the contents in your project directory. You can then include a local link to the rich text editor.


2 Answers

Or you can change the color using js:

tinyMCE.init(
        mode : "textareas",
        theme : "simple",
        oninit : "postInitWork"
    });

function postInitWork()
{
  var editor = tinyMCE.getInstanceById('myEditorid');
  editor.getBody().style.backgroundColor = "#FFFF66";
}
like image 130
S.P. Avatar answered Oct 01 '22 16:10

S.P.


I strongly advise you to use the tinymce configuration to influence styles in tinymce, instead of fiddling with core css files.

There is the content_css setting which allows you to specify a ccs file which will overwrite the default behaviour (css). That's the way to go. You may use the css from the other answers provided.

like image 20
Thariama Avatar answered Oct 01 '22 17:10

Thariama