How to apply multiple styles to one element in ckeditor?

自作多情 提交于 2019-12-09 20:16:45

问题


I want to integrate some bootstrap classes to my ckeditor profile:

{ name : 'Button Large' , element : 'a', attributes : { 'class' : 'btn-lg' } },
{ name : 'Button Primary' , element : 'a', attributes : { 'class' : 'btn-primary' } },

but the problem is those styles cant be combined. If I want a button which is btn-primary AND btn-lg I would have to create a third style:

{ name : 'Button Large Primary' , element : 'a', attributes : { 'class' : 'btn-lg btn-primary' } },

which obviously is quite redundant for many buttons and not necessary. So how can you do this?

Using CKeditor 4.4.3


回答1:


CKEditor does not currently support setting two styles on the same element from their dropdown. Have a look at this or this ticket in their tracker.

If adding the classes in the source view is not an option you may have to write your own plugin (like this SO user is doing for colors.



来源:https://stackoverflow.com/questions/29510288/how-to-apply-multiple-styles-to-one-element-in-ckeditor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!