【问题标题】:SCEditor - make the default font ArialSCEditor - 制作默认字体 Arial
【发布时间】:2021-10-05 15:22:27
【问题描述】:

SCEditor 为空时如何强制使用 Arial 作为默认字体?默认似乎是 Serif 字体 - 也许是 Times。

【问题讨论】:

    标签: fonts sceditor


    【解决方案1】:

    所见即所得内容的默认样式是浏览器默认样式。

    可以通过在构造函数中设置style option来改变它。建议使用(或基于您的样式)content/default.min.css 样式,因为它包含一些其他重要的 CSS。 比如:

    sceditor.create(textarea, {
        // other options here
        // ...
    
        // Set the style for the content of the editor
        style: 'https://cdn.jsdelivr.net/npm/sceditor@3/minified/themes/content/default.min.css'
    });
    

    也可以通过css() method设置,例如:

    instance.css('body { font-family: Arial, sans-serif; }');
    

    【讨论】:

      猜你喜欢
      • 2012-09-27
      • 2018-08-19
      • 1970-01-01
      • 2011-09-02
      • 2011-07-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多