admin管理员组

文章数量:1240574

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; }

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; }
Share Improve this question edited Dec 8, 2011 at 9:23 Helgi 5,4361 gold badge33 silver badges48 bronze badges asked Nov 7, 2011 at 19:59 JayJay 3221 gold badge6 silver badges21 bronze badges 3
  • 1 Did you empty your browser's cache? Sometimes you have to do that to ensure TinyMCE is not using an older file. – Kamil Sindi Commented Nov 7, 2011 at 21:22
  • Thanks bro!! U save my day....kill me.. – Jay Commented Nov 7, 2011 at 21:33
  • 2 @tuva: I know this is an old post. But just today I came accross this and I also edited the content.css and it did not work no matter if I cleared my cache or not. Then I found it on the tinyMCE website: tinymce./wiki.php/Configuration:content_css that you actually have to make a copy of the content.css file otherwise (so they say) it will have no effect. Which makes Jona's answer the correct one. – Nikola Commented Jun 13, 2012 at 13:34
Add a ment  | 

2 Answers 2

Reset to default 7

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.

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].

本文标签: javascriptTinyMCE default font sizeStack Overflow