我似乎无法使用此样式定义应用样式:
var object = {
type: CKEDITOR.STYLE_BLOCK,
attributes: {
'class': 'foo'
}
};
Run Code Online (Sandbox Code Playgroud)
var style = new CKEDITOR.style(object);
我在我的配置中将allowContent设置为true.
CKEditor中的样式定义没有该type属性.CKEditor使用element属性来知道何时以及如何应用样式:
var object = {
element: 'h1', // This style will be applied to h1 element
attributes: {
'class': 'foo'
}
};
Run Code Online (Sandbox Code Playgroud)
有关定义样式的更多示例可以在官方指南中找到.