I am unable to use inline css in ckeditor wyswig for full html . In Allowed HTML tags i have added but the tag "style" get removed in ckeditor and appears as in finally render of the page .how can i get be rendered.

I am trying to use <span style="font-size:1.5em; line-height: 1.5em;>Content </span> but it appears as <span>Content</span>.

  • Why do you want inline CSS with your content?
    – Joseph
    Jul 7 '17 at 15:00
  • its more of requirement by end user Jul 7 '17 at 15:12

If you have the "Limit allowed HTML tags" checked, it will generate a textarea at the bottom of the configuration of your full_html profile.

You need to authorize the "style" attribute on the span tag by adding this attribute on the list.

<span style>

By default, you have for links :

<a href hreflang>

If you define a new style explained on this documentation it will be added automatically.

EDIT: It seems that for XSS reason, style tag are stripped out everytime, see this thread where they talked about that. You have to create styles and define what kind of stuff your end user will be able to add. If you absolutely need your user to be able to add some style directly from code source of your ckeditor, you have to disable the option "Limit allowed HTML tags" but it's not recommended.

  • 1
    i did that but it still stripping style from <span> Jul 7 '17 at 15:31
  • 1
    You're right, I edited my post to add some precision I just discovered.
    – guilhom
    Jul 7 '17 at 15:44
  • 1
    that way it works but some how style get removed by theme Jul 7 '17 at 15:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.