Hello! How would I go about styling editor contents with CSS classes? I'm trying to build a small editing environment built around CKEditor, and at this point I need to style the visible contents from external javascript.
Any element, like p or table, should in some cases be kind of hilighted, so I thought I would simply .addClass('test') to the element and define the class in CSS, but even when I add a class to an element, the effects of the CSS are not shown. How would I affect the visible style of an element from outside of the editor?
I do
Any element, like p or table, should in some cases be kind of hilighted, so I thought I would simply .addClass('test') to the element and define the class in CSS, but even when I add a class to an element, the effects of the CSS are not shown. How would I affect the visible style of an element from outside of the editor?
I do
element.addClass('hasAttribute');After that when I view the code in CKEditor, I can see that the class is added but I can't see the style effects
.hasAttribute { background-color:#eee; border:1px dashed green; }
Re: Styling editor contents from external JavaScript?
My mistake: I had to add the CSS style definitions into the contents.css of CKEditor instead of the page hosting CKEDitor.