问题
I'm using FCKeditor to edit the contents of a div. This content div has an ID set so my CSS can target the p, li, img, etc tags contained. I want the FCKeditor's contents to look the same as my div's contents. I have @import'd my stylesheet in the fck_editorarea.css, but of course the FCKeditor body does not have the ID set, so the styles are not applied.
I have been trying to write a plugin for FCK to set the ID of the body tag in the inner iframe but can't get it working. Can anyone suggest a solution or better approach?
回答1:
There is no need for a plugin. Find these lines in FCKedotor's confing file, fckconfig,js
// This will be applied to the body element of the editor
FCKConfig.BodyId = '' ;
FCKConfig.BodyClass = '' ;
and change empty body id to whatever you need.
来源:https://stackoverflow.com/questions/1833789/add-class-or-id-to-fckeditors-editable-iframe-body