Stan
Stan

Reputation: 84

CKEditor Defining custom margins for inserted image

I met a limit with quite typical operation. Simple document: https://i.sstatic.net/JNI9v.png

As you can see, image has right and bottom margins. But... CKEditor image dialogue provides VSpace and HSpace parameters which influence together to Top-Bottom or Left-Right twin values and adds unnecessary top and left margins: https://i.sstatic.net/vo3oC.png

Of course, users won't use pure code to define this in style="..." attribute. So, how to allow users insert images as shown on the first image? Maybe exists CKEditor plugin or patch... and i just can't find it.

Upvotes: 6

Views: 2679

Answers (1)

Wiktor Walc
Wiktor Walc

Reputation: 5560

Another, maybe even a simpler way, to achieve what you want would be to use a predefined set of styles for images and use the "Styles" combo to apply one of preselected classes. This way the styles used for images could be more consistent.

To see what I mean you can check the "Standard" demo - click on an Image and in the "Styles" combo select "Object styles -> Styled image (right)"

Upvotes: 3

Related Questions