Add class or ID to FCKeditor's editable iframe body

强颜欢笑 提交于 2019-12-13 02:08:24

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!