Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
66
rated 0 times [  71] [ 5]  / answers: 1 / hits: 8764  / 10 Years ago, mon, may 19, 2014, 12:00:00

By default in tinymce there are no image floating, only image, text alignment should I do it manually or there already are some plugins? can't find any...or how can I get the current selected elements and float them?


More From » tinymce

 Answers
0

you can use style_formats option.

Document is here: https://www.tiny.cloud/docs/configure/content-formatting/#style_formats




This option enables you to add more advanced style formats for text
and other elements to the editor. The value of this option will be
rendered as styles in the Formats dropdown.




You can go like this when you initialize a tinymce.



tinymce.init({
...
style_formats: [
{
title: 'Image Left',
selector: 'img',
styles: {
'float': 'left',
'margin': '0 10px 0 10px'
}
},
{
title: 'Image Right',
selector: 'img',
styles: {
'float': 'right',
'margin': '0 0 10px 10px'
}
}
]
});


Hope this helps.


[#45224] Friday, May 16, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
arlethjeanettep

Total Points: 506
Total Questions: 96
Total Answers: 79

Location: Liberia
Member since Tue, Mar 14, 2023
1 Year ago
;