gpt4 book ai didi

tinymce 编辑器内容样式不正确

转载 作者:行者123 更新时间:2023-12-05 00:35:47 33 4
gpt4 key购买 nike

我正在为我的网站构建一个小型 web 应用程序,并将 tinyMCE 作为可视化编辑器。
我的网站使用免费模板,内容区域的 id #left_side 几乎所有样式都引用了该 ID,与文章相关。

所以编辑器是一种所见即所得,但样式是错误的,因为我作为 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",
....

最佳答案

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

  • http://www.tinymce.com/wiki.php/Configuration:body_class
  • http://www.tinymce.com/wiki.php/Configuration:custom_elements

  • 另请参阅我在 Skype 中的其他评论。

    关于tinymce 编辑器内容样式不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8989185/

    33 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com