我有一个用于编辑博客内容的 CKEditor。有时有些博客的背景颜色较深,因此使用白色作为字体颜色。由于CKEditor文本编辑区默认背景色为白色,所有文本只能高亮显示。
虽然我想要这样的东西(但仅当字体颜色为白色时):
我正在使用 CKEditor 4.6。如何根据用户选择的字体颜色动态更改 CKEditor 的背景颜色?
最佳答案
一个选择是使用 Div Editing Area插件,继承网页CSS样式(字体颜色和背景颜色):
This plugin uses a
<div>
element (instead of the traditional<iframe>
element) as the editable area in the themedui creator. Much similar to inline editing, it benefits from allowing the editor content to inherit from host page styles.
关于javascript - CKEditor文本编辑区的背景色如何根据文字颜色改变?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42382437/