CKEditor:编辑器主体的类或ID [英] CKEditor: Class or ID for editor body

查看:86
本文介绍了CKEditor:编辑器主体的类或ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个页面上有一个CKEditor实例。我试图给CKEditor的主体一个类或ID,所以它匹配一些样式我已经定义在样式表中。

I have an instance of CKEditor on a page. I am trying to give the CKEditor's body a class or ID so it matches some styles I have defined in a stylesheet.

有一个 API文档,应该可以访问相应的DOM元素,但我似乎无法获得它工作。

There is a API documentation that should give access to the respective DOM elements, but I can't seem to get it working. All objects I try to query that way turn out undefined.

有没有人知道如何做到这一点,或者如何正确地解决CKEditor的dom元素?

Does anybody know how to do this, or how to properly address CKEditor's dom elements?


编辑:感谢大家,nemisj的答案是为我做的,但由于某种原因,我不能设置在这个问题的复选标记。

Edit: Thanks folks, nemisj's answer did it for me but for some reason, I don't get to set the "accepted" checkmark in this question.


推荐答案

虽然这部分API并没有从2.x移植此问题已放置,现在更容易使用 bodyId bodyClass 配置选项。

Although that part of the API wasn't ported from 2.x at the time that this question was placed, now it's easier to use the bodyId and bodyClass config options.

当然,nemisj的解释是好的,可以用于其他的事情,但你必须记住,每当你从设计(到源视图)切换,iframe是销毁,因此如果您手动执行,您需要重新分配属性。

Of course, the explanation by nemisj is good and can be useful for other things, but you must remember that each time that you switch away from design (to source view), the iframe is destroyed, so you'll need to reassign your attributes if you do it manually.

这篇关于CKEditor:编辑器主体的类或ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆