CKEditor 4组合css

CKEditor 4组合css,css,ckeditor,Css,Ckeditor,我在我的网站上使用CSS来设置项目的样式 在我自己开发的CMS中,我使用CKEditor作为所见即所得编辑器 我想编辑有我的网页上的内容相同的风格。 我的页面的CSS如下所示: .content { ... } .content ul, .content ol { ... } .content p { ... } body { ... } ol,ul,dl { ... } h1,h2,h3,h4,h5,h6 { ... } 但是CKEdi

我在我的网站上使用CSS来设置项目的样式

在我自己开发的CMS中,我使用CKEditor作为所见即所得编辑器

我想编辑有我的网页上的内容相同的风格。 我的页面的CSS如下所示:

.content 
{
    ...
}
.content ul, .content ol 
{
    ...
}
.content p
{
    ...
}
body
{
    ...
}
ol,ul,dl
{
    ...
}

h1,h2,h3,h4,h5,h6
{
    ...
}
但是CKEditor contents.css的样式表如下所示:

.content 
{
    ...
}
.content ul, .content ol 
{
    ...
}
.content p
{
    ...
}
body
{
    ...
}
ol,ul,dl
{
    ...
}

h1,h2,h3,h4,h5,h6
{
    ...
}
有没有办法将其放入一个样式表中,或者编辑CKEditor,从而添加div.content

我找到了答案,将config.js更改为:

CKEDITOR.editorConfig = function( config ) {
    config.bodyClass = 'content'; //class that body needs to refer to
    config.contentsCss = '/css/beheer.css'; //your stylesheet
CKEDITOR.editorConfig = function( config ) {
    config.bodyClass = 'content'; //class that body needs to refer to
    config.contentsCss = '/css/beheer.css'; //your stylesheet
在CKEDITOR中,您可以为任何ol、ul、dl、h1等元素编写标记


只需转到CKEDITOR中的“源代码”按钮,然后您就可以按您想要的方式进行编辑。

就像我在startpost上编辑的一样,我自己找到了答案:

将config.js更改为:

CKEDITOR.editorConfig = function( config ) {
    config.bodyClass = 'content'; //class that body needs to refer to
    config.contentsCss = '/css/beheer.css'; //your stylesheet
CKEDITOR.editorConfig = function( config ) {
    config.bodyClass = 'content'; //class that body needs to refer to
    config.contentsCss = '/css/beheer.css'; //your stylesheet

一旦你找到了解决方案,请将你的问题标记为已解决,让其他人知道这里没有什么可做的。