Search code examples
djangodjango-ckeditor

Add css style to django ckeditor


I'm using django ckeditor

I can add and edit HTML tags, but can't add CSS styles enter image description here

Is there any way to add CSS style to the content?


Solution

  • You can add 'allowedContent': True to your CKEDITOR_CONFIGS, in the settings.py file:

    CKEDITOR_CONFIGS = {
        'default': {
            # ... your default config...
            'allowedContent': True
        }
    }
    

    You can see a full config example in the docs: https://django-ckeditor.readthedocs.io/en/latest/#example-ckeditor-configuration