Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TinyMCE default font size

How can I set the default font size of tinyMCE , I've a tinyMCE editor and I tried all the things to change the text-size to 14px and it always shows 10px. I'm using rails 3.1 and tinymce major Version: '3', and minor Version: '4.4'.

I changed tinymce/themes/advanced/skins/default/content.css font-size to 14px I even add

tinyMCE.init({
    theme_advanced_font_sizes: "10px,12px,13px,14px,16px,18px,20px",
    font_size_style_values: "12px,13px,14px,16px,18px,20px",
});

and

body, td, pre { color: #000; font-family: Verdana, Arial, Helvetica, sans-serif; 
    font-size: 14px; margin: 8px; }
like image 959
Jay Avatar asked Nov 07 '11 19:11

Jay


People also ask

How do you change the font on TinyMCE?

TinyMCE comes with 17 font options by default. Depending on the editor configuration, users can select a font from the menubar or the toolbar (via the fontselect dropdown). A user selects a font from the fontselect toolbar menu.

How do I set the default font family in Ckeditor?

To change the default font for text to which a style has not been applied, open \CRM\WWWRoot\ckeditor\contents. css and edit the body section at the top of the file. The following example changes the default font to Courier New.


2 Answers

You can load a custom stylsheet for the textarea:

tinyMCE.init({
  content_css : "custom_content.css"
});

In there you can style your fonts like on a normal page.

like image 107
Jona Avatar answered Oct 07 '22 07:10

Jona


You need to empty you browser's cache. Sometimes you have to do that to ensure TinyMCE is not using an older file.

[As @Jona and @Nikola said, please make sure you are referencing a new CSS flle].

like image 33
Kamil Sindi Avatar answered Oct 07 '22 06:10

Kamil Sindi