我在为 CKEditor 实例设置默认字体大小时遇到问题。我尝试过谷歌搜索,但没有找到任何可以回答我的问题的内容。
我有一个需要网站输入的页面。有 3 个编辑器实例,我必须将第一个实例的默认字体大小设置为大约 20 到 30 像素。
我尝试修改 CKEDITOR 文件夹中的 content.css 并更改其中的字体大小,但它会影响所有 3 个编辑器实例
/*
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
body
{
/* Font */
font-family: Georgia;
font-size: 12px;
/* Text color */
color: #222;
/* Remove the background color to make it transparent */
background-color: #fff;
}
ol,ul,dl
{
/* IE7: reset rtl list margin. (#7334) */
*margin-right:0px;
/* preserved spaces for rtl list item bullets. (#6249)*/
padding-right:40px;
}
有人知道如何解决这个问题吗? 非常感谢任何帮助!..
先谢谢你们了..
mhond
最佳答案
希望以上的回答可以帮助到一些人。他们没有帮助我,这就是原因。使用 firebug,我可以看到 about:blank 有一个 p 标签的默认字体,它覆盖了我在 content.css 文件中的设置,如上所述。这是我修复它的方法。我在 body 标记中添加了 p,并在 font-family 和 font-size 行中添加了 !important:
body, p {
/* Font */
font-family: Arial, Verdana, sans-serif !important;
font-size: 12px !important;
/* Text color */
color: #000;
/* Remove the background color to make it transparent */
background-color: #fff;
}
效果很好!我希望这会有所帮助。
关于javascript - 如何在 CKEditor 上设置默认字体大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8925137/