Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting default font size and background color in TinyMCE

Tags:

tinymce

How can I set the default font size and the background color in TinyMCE?

Thanks, Eden

like image 880
Eden Avatar asked Jul 14 '09 10:07

Eden


1 Answers

You can change the css using Javascript also.

Add this to your init function:

oninit : "postInitWork",

and

function postInitWork() {
    tinyMCE.getInstanceById('textedit').getWin().document.body.style.backgroundColor='#FFFF66';

    var dom = tinymce.activeEditor.dom;
    var pElements = dom.select('p'); // Default scope is the editor document.

    dom.setStyle(pElements, 'color', 'red');
}
like image 142
S.P. Avatar answered Oct 23 '22 04:10

S.P.