如何自定义 TinyMCE 按钮输出 [英] How to customize TinyMCE button output

查看:54
本文介绍了如何自定义 TinyMCE 按钮输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想更改缩进按钮的默认行为.默认情况下,缩进按钮会向段落标签添加一个 css 样式 padding-left: 30px; .我想将其更改为 margin-left: 20px 或任何数量.

I would like to change the default behavior of the indent button. By default the indent button adds a css style padding-left: 30px; to the paragraph tag. I would like to change that to margin-left: 20px or whatever number amount.

推荐答案

我不确定不侵入 tinyMCE 代码是否可行.一种选择可能是使用自定义样式,如下所示:http://www.tinymce.com/wiki.php/Configuration:style_formats

I'm not sure it is possible without hacking into tinyMCE code. One option might be using custom style as shown here: http://www.tinymce.com/wiki.php/Configuration:style_formats

tinyMCE.init({
    ...
    style_formats : [
        {title : 'Indented text', inline : 'p', styles : {marginLeft : '20px'}}
    ]
});

然后应用样式而不是按缩进按钮.

And then apply the style instead of pressing indent button.

这篇关于如何自定义 TinyMCE 按钮输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆