ALLIGNING THE IMAGE AND TEXT TO BE ALLIGNED CENTERD BY DEFAULT #5695
-
Anybody can help me with in which file i can customise the allignment of the image and texts by default |
Beta Was this translation helpful? Give feedback.
Answered by
mosh-tudor
Feb 22, 2024
Replies: 1 comment 4 replies
-
You can start from the file where you initialized the editor.
For text you can do this: editor.DomComponents.addType('text', {
model: {
defaults: {
style: {
'text-align': 'center',
},
},
},
});
This is more difficult because images are inline elements (+/-) and must be horizontally aligned within the parent element. You can try: editor.DomComponents.addType('image', {
model: {
defaults: {
style: {
'display': 'block',
'margin-right': 'auto',
'margin-left': 'auto',
},
},
},
}); |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As I said before, images are inline elements (+/-) and must be horizontally aligned within the parent element. You have nothing to do here without workarounds.
There is also the option with float (float: left/right/none), but that can bring other problems...