我想将一些引导类集成到我的 ckeditor 配置文件中:
{ name : 'Button Large' , element : 'a', attributes : { 'class' : 'btn-lg' } },
{ name : 'Button Primary' , element : 'a', attributes : { 'class' : 'btn-primary' } },
但问题是这些样式无法组合。如果我想要一个 btn-primary
和 btn-lg
的按钮,我必须创建第三种样式:
{ name : 'Button Large Primary' , element : 'a', attributes : { 'class' : 'btn-lg btn-primary' } },
这对于许多按钮来说显然是多余的并且没有必要。那么如何才能做到这一点呢?
使用CKeditor 4.4.3
最佳答案
CKEditor 目前不支持从下拉列表中在同一元素上设置两种样式。看看this或this跟踪器中的票证。
如果无法在源 View 中添加类,您可能必须编写自己的插件(例如 this SO user is doing for colors 。
关于javascript - 如何在ckeditor中对一个元素应用多种样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29510288/