简体   繁体   English

如何在CKEditor中设置默认字体Verdana?

[英]How can I set default font Verdana in CKEditor?

HTML Code: HTML代码:

    <textarea name="editor" id="editor" rows="9" style='width:79%;'></textarea>

Initialization: 初始化:

    <script>
    CKEDITOR.replace('editor', {toolbar: [
    {name: 'basicstyles', groups: ['basicstyles', 'cleanup'], items: ['Bold', 'Italic', 'Underline', '-', 'TextColor', 'BGColor']},
    {name: 'styles', items: ['Font', 'FontSize']},
    {name: 'insert', items: ['Image']},
    {name: 'paragraph', groups: ['list', 'indent', 'blocks', 'align', 'bidi'], items: ['NumberedList', 'BulletedList', '-', 'Blockquote', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock']},
    ]
 });
</script>

Now, I want to set default font Verdana. 现在,我要设置默认字体Verdana。 How can I set default font in the time of initialization. 如何在初始化时设置默认字体。

Add below line in config.js of ckeditor 在ckeditor的config.js中添加以下行

  config.font_defaultLabel = 'verdana';
  config.fontSize_defaultLabel = '12px';
  config.contentsCss = ['../contents.css'].concat(myFonts);

Add

    body
{
    /* Font */
    font-family: verdana;
    font-size: 12px;

    /* Text color */
    color: #333;

    /* Remove the background color to make it transparent */
    background-color: #fff;

    margin: 20px;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM