如何将多种样式应用于ckeditor中的一个元素? [英] How to apply multiple styles to one element in ckeditor?

查看:328
本文介绍了如何将多种样式应用于ckeditor中的一个元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

但问题是这些样式不能组合。如果我想要一个按钮,它是 btn-primary AND btn-lg 我必须创建第三个样式: / p>

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

这显然对于许多按钮来说是相当多余的,而不是必需的。那么你该怎么做呢?



使用CKeditor 4.4.3

解决方案

p> CKEditor当前不支持在其下拉列表中的同一个元素上设置两个样式。看看这个这个在他们的跟踪器中。



如果在源视图中添加类不是一个选项可能必须编写自己的插件(例如这个SO用户正在为颜色做


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

解决方案

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.

这篇关于如何将多种样式应用于ckeditor中的一个元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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