I'm using TinyMCE as WYSIWYG editor. When I set the floating of an image to "left" or "right", I want to set a right- of left-margin with CSS automatically. So the images has only a gap between img and text.

When I just add a margin to the IMG, there's a at all sides...

1 Answer 1


If the styles WYSIWYG button shows image right or image left try applying that and save your edit. If that applies ok you can use Firebug to see the CSS class it adds to the image and just alter the css rules to your needs.

Or else, you can supply your own css styles to a wysiwyg profile. They are typically of the form:


for example:


you then make an image right class in your themes css file:

.img-right { padding: 0 0 5px 5px; }

I believe both TinyMCE and/or the WYSIWYG module both support these features.


Your Answer

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

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