CKEditor 4结合css [英] CKEditor 4 combinate css
本文介绍了CKEditor 4结合css的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我自己开发的CMS中,我使用CKEditor作为WYSIWYG编辑器。
我希望编辑器具有与我的网页上的内容相同的样式。
我的页面的CSS看起来像这样:
.content
{
。 。
}
.content ul,.content ol
{
...
}
.content p
{
...
}
但是CKEditor(contents.css)的样式表如下:
body
{
...
}
ol,ul ,dl
{
...
}
h1,h2,h3,h4,h5,h6
{
...
}
有一种方法可以把它放到一个样式表中, ,因此添加了div.content?
我找到了答案,将config.js更改为: CKEDITOR.editorConfig = function(config){
config.bodyClass ='content'; //该体需要引用的类
config.contentsCss ='/css/beheer.css'; //你的样式表
解决方案
我自己找到答案:
将config.js更改为:
CKEDITOR.editorConfig = function(config){
config.bodyClass ='content'; //该体需要引用的类
config.contentsCss ='/css/beheer.css'; //你的样式表
I use CSS on my website to style the items.
In my (own developed) CMS I use CKEditor as WYSIWYG-editor.
I would like the editor to have the same style as the content on my webpage. The CSS of my page looks like this:
.content
{
...
}
.content ul, .content ol
{
...
}
.content p
{
...
}
But the stylesheet of CKEditor (contents.css) looks like this:
body
{
...
}
ol,ul,dl
{
...
}
h1,h2,h3,h4,h5,h6
{
...
}
Is there a way to make this in to one stylesheet, or to edit CKEditor, so a div.content is added?
I found the answer, change config.js to:
CKEDITOR.editorConfig = function( config ) {
config.bodyClass = 'content'; //class that body needs to refer to
config.contentsCss = '/css/beheer.css'; //your stylesheet
解决方案
Like I edited on the startpost, I found the answer myself:
Change config.js to:
CKEDITOR.editorConfig = function( config ) {
config.bodyClass = 'content'; //class that body needs to refer to
config.contentsCss = '/css/beheer.css'; //your stylesheet
这篇关于CKEditor 4结合css的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文