javascript - CKEditor:使字体大小组合框可编辑或使用新控件

标签 javascript ckeditor

有什么想法如何使 CKEditor 字体大小组合框可编辑以允许自定义字体大小吗?

或者我如何添加自己的字体大小控件而不是组合框?

例如,我想用输入替换组合框。

最佳答案

我不知道用户输入自定义字体大小的方法,但您可以使用 fontSize_sizes 配置属性来更改向用户显示的默认字体大小。

来自docs :

The list of fonts size to be displayed in the Font Size combo in the toolbar. Entries are separated by semi-colons (';').

Any kind of "CSS like" size can be used, like '12px', '2.3em', '130%', 'larger' or 'x-small'.

A display name may be optionally defined by prefixing the entries with the name and the slash character. For example, 'Bigger Font/14px' will be displayed as 'Bigger Font' in the list, but will be outputted as '14px'.

config.fontSize_sizes = '16/16px;24/24px;48/48px;';

config.fontSize_sizes = '12px;2.3em;130%;larger;x-small';

config.fontSize_sizes = '12 Pixels/12px;Big/2.3em;30 Percent More/130%;Bigger/larger;Very Small/x-small';

关于javascript - CKEditor:使字体大小组合框可编辑或使用新控件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40766632/

相关文章:

angularjs - 使用 AngularJS 实现 CKEditor(pasteState 事件)

javascript - 'ckeditor4-react' 和 'HTML5 video' 插件

javascript - 在ckeditor中显示html标签

javascript - 如何使用 javascript 异步更新我的内容?

javascript - 在 Angularjs 中渲染 HTML 和 CSS

javascript - JS : wait till other frame load

javascript - 重新调整 Jeditable jQuery 插件的用途以使用按钮而不是文本单击?

javascript - 在新选项卡中打开 url 或尽可能重复使用现有的 url

javascript - CKeditor 内联工具栏下拉菜单上的按键事件

html - 更改ckeditor的背景?