Ckeditor 更改编辑区域背景色

Ckeditor 更改编辑区域背景色,ckeditor,Ckeditor,如何使用ckeditor插件“Div editing area”更改编辑区背景色 使用“Iframe editing area”插件,我使用了contentsCss,它可以像这样改变主体部分,并且效果很好: CKEDITOR.replace('Description', { uiColor: '#a7bdea', width: 'auto', height: '150', enterM

如何使用ckeditor插件“Div editing area”更改编辑区背景色

使用“Iframe editing area”插件,我使用了
contentsCss
,它可以像这样改变主体部分,并且效果很好:

CKEDITOR.replace('Description',
        {
            uiColor: '#a7bdea',
            width: 'auto',
            height: '150',
            enterMode: CKEDITOR.ENTER_BR,
            shiftEnterMode: CKEDITOR.ENTER_P,
            contentsCss : body{ background : red}
        });
但ckeditor似乎忽略了带有div区域编辑的
contentsCss
。有什么想法吗?

残忍但有效:

CKEDITOR.replace( 'editor1', {
    extraPlugins: 'divarea',
    on: {
        instanceReady: function() {
            this.editable().setStyle( 'background-color', 'red' );
        }
    }
} );
残忍但有效:

CKEDITOR.replace( 'editor1', {
    extraPlugins: 'divarea',
    on: {
        instanceReady: function() {
            this.editable().setStyle( 'background-color', 'red' );
        }
    }
} );

将此行添加到代码中:

CKEDITOR.addCss(".cke_editable{background-color: red}");

将此行添加到代码中:

CKEDITOR.addCss(".cke_editable{background-color: red}");
是一个字符串(或字符串数组)。这些字符串是指向样式表文件的URL。这就是为什么CKEditor忽略您的设置。是一个字符串(或字符串数组)。这些字符串是指向样式表文件的URL。这就是为什么CKEditor会忽略您的设置。