更改ckeditor的背景? [英] Change background of ckeditor?

查看:82
本文介绍了更改ckeditor的背景?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更改CKEditor的背景颜色(用户在其中键入文本)?我需要动态地执行此操作,但是我找不到需要更改的元素。

How do I change the background colour of CKEditor, where the user types the text? I need to do this dynamically but I cant find the element that needs to change. ANy idea of how to target it?

推荐答案

您可以尝试以下方法:

CKEDITOR.instances.editor1.document.getBody().setStyle('background-color', 'red');

其中 CKEDITOR.instances.editor1 是编辑器实例-您可以对此进行测试此处: http://ckeditor.com/demo

Where CKEDITOR.instances.editor1 is an instance of editor - you can test this e.g. here: http://ckeditor.com/demo

这篇关于更改ckeditor的背景?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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