How to apply multiple styles to one element in cke

2019-04-13 04:23发布

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条回答
ら.Afraid
2楼-- · 2019-04-13 05:08

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.

查看更多
登录 后发表回答