javascript TinyMCE 默认字体大小

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8041840/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 02:04:53  来源:igfitidea点击:

TinyMCE default font size

javascripthtmlcsstinymce

提问by Jens

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

如何设置 tinyMCE 的默认字体大小,我有一个 tinyMCE 编辑器,我尝试了所有方法将文本大小更改为 14px,但它始终显示为 10px。我正在使用 rails 3.1 和 tinymce major Version: '3' 和小版本: '4.4'

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

我将 tinymce/themes/advanced/skins/default/content.css 字体大小更改为 14px 我什至添加

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

采纳答案by Kamil Sindi

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

您需要清空浏览器的缓存。有时您必须这样做以确保 TinyMCE 不使用旧文件。

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

[正如@Jona 和@Nikola 所说,请确保您正在引用新的 CSS 文件]。

回答by Jona

You can load a custom stylsheetfor the textarea:

您可以为 textarea加载自定义样式表:

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

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

在那里,您可以像在普通页面上一样设置字体样式。