【发布时间】:2021-06-11 09:19:12
【问题描述】:
我无法更改富文本编辑器的背景颜色。大多数地方都说要编辑ckeditor css文件,但这不在我的django项目中,因为我认为我正在这样做。有没有办法在设置配置中更改它/添加样式?还是有更好的方法来做到这一点?
模板:
<script type="text/javascript" src="ckeditor.js">
window.CKEDITOR_BASEPATH = '/static/ckeditor/ckeditor/';
CKEDITOR.replace( 'links' );
</script>
设置文件:
CKEDITOR_CONFIGS = {
'default': {
'toolbar': 'Custom',
'toolbar_Custom': [
['Link', 'Unlink'],
],
'height': 200,
'width': 750,
'stylesSet': [
{
"name": 'Lead',
"element": 'p',
"attributes": {"margin-top": "10px"},
},
],
}
}
【问题讨论】:
标签: django django-forms ckeditor django-ckeditor