I'm using wysiwyg api with ckeditor, but I can't make it to use inline styles like when I use indent from editor, it actually drops the style (which is margin-left) in output. it's not an override, it actually doesn't even appear in the code when I inspect it.

3 Answers 3


Verify the format used by the body field. If you are using Filtered HTML, filtering is done before rendering it on the page, where all inline styling is removed.

You could either set your format on Full HTML (which doesn't filter the body) or use the WYSIWYG Filter module which allows to enable certain inline styles on the Filtered HTML format.


If Mike's solution is not working, then check my answer and see if that fits your situation.

I know for a fact that Wysiwyg with CK Editor had several problems in it's integration with Media, but a fix was release a few days which actually applies the styling.

So previously, when I used to click on an image, and change it's width and height. It would look in wysiwyg, but on clicking source code, I could not see it on inspection, and it would again look like the original on wysiwyg. Your problem sounds similar, so I'm pointing you towards the wysiwyg and ckeditor fix. Tell me if that worked for you

a) Media + Wysiwyg -: https://drupal.org/comment/8009717#comment-8009717 b) Wysiwyg + Ckeditor -: https://drupal.org/node/1956778 (patch 37)

Need to both if it's' with Media, else just the latter. Please test on local before you apply on server.

  • 1
    Thanks Pratik, I'll look into it tomorrow and let you know
    – user23288
    Nov 4, 2013 at 7:25
  • @Gus - Do let us know if you were successful or not. Nov 4, 2013 at 13:47

I know it's a relatively old question, but I found myself in a similar situation today, so maybe the solution I found will be of use to somebody else.

In my case, it appears that the problem came from CKEditor itself, which apparently implemented a new feature related to code cleaning, starting with version 4.1. (It's called Advanced Content Filter (ACF), and there's a discussion about it here: https://www.drupal.org/node/1956778) The current stable version of the wysiwyg module (which hasn't been updated for more than two years) doesn't take that into account, which means the user can't disable this feature.

The solution is simple: install the dev version of the wysiwyg module. It provides a new option that allows the user to disable or customize CKEditor's AFC.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.