TinyMCE has always been a little difficult to align images. Either the alignment tag or the addition of style = "float: left;" was his decision. Ideally, I just want to add class = "left" or class = "right" so that I can set the border and margins of the image.
So far, the only way to do this without using the advimage plugin was to insert an image, and then select it, choose a style from the style menu.
Ideally, I should be able to use the align control in the image dialog box to set the alignment class or use the alignment elements on the toolbar in the main editing window.
I just started looking for a solution to this question, now that IE6 is finally starting to die, I can use CSS attributes in selectors, so
IMG[style="float: left;"] {}
It works, but I would prefer to use the incase class, there are other style attributes that will cause the selector to fail. And this does not work in IE6, and you know that some corporate clients will still manage the feature!
So, I looked at the TinyMCE documentation and found a format configuration option that allows you to specify how tinyMCE applies code for various operations. Here I can add the IMG tag as a selector and have classes: "left" for the alignleft function.
This correctly applies the class when alignment is selected on the toolbar, but it still records the inline style when alignment is selected through the image dialog.
Am I doing something wrong or is there a better way to do this so that my clients can choose image alignment both from the image dialog and from the toolbar, applying a class to the image?