How can I set the default font size and the background color in TinyMCE?
Thanks, Eden
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');
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With