【发布时间】:2012-02-17 20:07:31
【问题描述】:
我正在为我的网站构建一个小型 web 应用程序,并包含 tinyMCE 作为可视化编辑器。 我的网站使用免费模板,并且 contentarea 的 id 为 #left_side,几乎所有样式都引用它,这在文章中是相关的。
所以编辑器有点所见即所得,但样式是错误的,因为我作为 content_css 提供的样式不适合。
我假设是,因为 #left_side id 不在 iframe 中的任何位置。
我已经用谷歌搜索了很长一段时间,发现无法让 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",
....
【问题讨论】:
-
你是如何设置 content_css 的?请提供您的 tinymce 初始化
标签: tinymce