CKEditor allow style html

CKEditor is wysiwyg base javascript, so you can integrate it with controll panel website , you can get more info at ckeditor website

default config ckeditor not allowed you to write your own html style, unless it source view

example if you write

ckeditor config

<p style='color#c00;'>loremp</p>


CKEditor will replace this code become



and you cannot get your style …


solution is here!/guide/dev_allowed_content_rules

the dev_allowed_content_rules set default false, so the ckeditor will strip almost your code html

in config.js
add line

CKEDITOR.editorConfig = function( config ) {
	config.allowedContent = true;

and you will get the style enable


Published by


just to remember what i had known :)

One thought on “CKEditor allow style html”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s