tinymce编辑器内容没有正确的样式

Pat*_*sen 4 tinymce

我正在为我的网站构建一个小型webapp,并将tinyMCE作为可视化编辑器.我的网站使用免费模板,而contentarea的文章名称为#left_side,几乎所有样式都引用了这些内容.

所以这个编辑器有点像wysiwyg,但样式是错误的,因为我提供的内容为content_css的样式不适合.

我认为是,因为#left_side id不在iframe中的任何位置.

我已经google了很长一段时间,发现没有办法让tinyMCE添加例如带有编辑内容的这个ID的div,所以css会起作用.

我认为这很难完成,我目前还不知道如何...: - /

有任何想法吗?

编辑:内容CSS添加如下:

tinyMCE.init({
    // General options
    mode : "textareas",
    theme : "advanced",
    plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",

    // Theme options
    theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
    theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
    theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
    theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_statusbar_location : "bottom",
    theme_advanced_resizing : true,

    // Example content CSS (should be your site CSS)
    content_css : "/cms/static/style/site.css",
    ....
Run Code Online (Sandbox Code Playgroud)

小智 6

不确定,但也许以下配置选项之一可以做到这一点.

请参阅我在Skype的其他评论.