Reputation: 348
I have a CKEditor control for editing html content, then save it. When I finished editing, the ckeditor is hidden and html is rendered in a div. Depending if user can edit or not html, the ckeditor is available or not.
So, the problem is, the css of my webpage is applied to the rendered html. I want the html in my div the same style of when I edit it with ckeditor. Not not the opposite (I don't want to apply my own style to ckeditor).
Can someone help me ?
Edit: The only thing that look like something that can work is that
Upvotes: 0
Views: 2071
Reputation: 3151
Inside CKEditor folder, you'll find contents.css
. You can use it to have the same style as CKEditor.
contents.css
in your webpage.<div>
outside
CKEditor html data and give it a class of .cke_editable
to use the
CSS rules of contents.css
.contents.css
.EDIT: Another solution would be:
contents.css
, so as to use it separately.body
rules to .cke_editable
rules (put them above the existing .cke_editable
rules) and delete body
section..cke_editable
, so as to work only with the contents, so blockquote
becomes .cke_editable blockquote
..cke_editable
from 20px
to, let's say, 10px
, to account for the margin
of the body
of your webpage.Upvotes: 2