user2646118
user2646118

Reputation: 1

Change edit area background color

How to change the editing area background color using the ckeditor plugin "Div editing area" ?

With the "Iframe editing area" plugin, I use contentsCss which alter the body section like this, and it works fine :

CKEDITOR.replace('Description',
        {
            uiColor: '#a7bdea',
            width: 'auto',
            height: '150',
            enterMode: CKEDITOR.ENTER_BR,
            shiftEnterMode: CKEDITOR.ENTER_P,
            contentsCss : body{ background : red}
        });

But it seems ckeditor ignores contentsCss with div area editing. Any ideas?

Upvotes: 0

Views: 5753

Answers (2)

juice
juice

Reputation: 587

Add this line to your code:

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

Upvotes: 3

oleq
oleq

Reputation: 15895

Brutal, yet working:

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

Upvotes: 1

Related Questions