2016-07-03 44 views
0

嗨,我为CKEDITOR创建了插件。我想制作一个公告箱。当用户点击添加通知框按钮并填写表单时。插件创建这些源代码:在ckeditor中添加类的样式

<div class="notice-box"> 
    <i class="icon-info">info</i> 
    <span class="notice-box__info">Lorem ipsum.... </span> 
</div> 

它一切正常。但现在我想为此添加一些风格。 ckeditor级别的样式不适用于生产。我怎样才能为CKeditor添加这些类的样式?

回答

1

插件和小部件可以添加自己的样式表。例如:

CKEDITOR.plugins.add('example', { 
    init: function(editor) { 
     var pluginDirectory = this.path; 
     editor.addContentsCss(pluginDirectory + 'styles/example.css'); 
    } 
}); 

请参阅文档here