Image insert with text in ckeditor

  Kiến thức lập trình

I am using ckeditor 4 currently and i have to implement a feature which is build in ckeditor 5
of image can be put aside and text can be written another side of the image as image shown how can i implement that in CKeditor 4your text

i tried 
CKEDITOR.stylesSet.add('my_styles', [
    // Block-level styles
    { name: 'Image on Left', element: 'img', attributes: { 'class': 'left' } },
    { name: 'Image on Right', element: 'img', attributes: { 'class': 'right' } },
    // Inline styles
    { name: 'CSS Style', element: 'span', attributes: { 'class': 'my_style' } },
    { name: 'Marker', element: 'span', attributes: { 'class': 'marker' } }
]);

// The above custom styles are loaded in the CKEditor configuration.
config.stylesSet = 'my_styles';
that in the style.js
and 


/* contents.css */
img.left {
    float: left;
    margin: 0 15px 15px 0;
}

img.right {
    float: right;
    margin: 0 0 15px 15px;
}


in style.css section

New contributor

Harsh Soni _21 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT