【发布时间】:2021-10-05 15:22:27
【问题描述】:
SCEditor 为空时如何强制使用 Arial 作为默认字体?默认似乎是 Serif 字体 - 也许是 Times。
【问题讨论】:
SCEditor 为空时如何强制使用 Arial 作为默认字体?默认似乎是 Serif 字体 - 也许是 Times。
【问题讨论】:
所见即所得内容的默认样式是浏览器默认样式。
可以通过在构造函数中设置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; }');
【讨论】: