Create style that can be applied to div in ckeditor?

ckeditor

Solution

I found what I needed to change in styles.js

CKEDITOR.stylesSet.add( 'default', [


    { name: 'Italic Title',     element: 'h2', styles: { 'font-style': 'italic' } },
    { name: 'Subtitle',         element: 'h3', styles: { 'color': '#aaa', 'font-style': 'italic' } },
    {
        name: 'Image caption', //THESE NEXT 4 LINES I CHANGED 
        element: 'div',
        attributes: {
            class: 'caption-mine'
        }
    },

Problem

My ckeditor WYSIWYG has the option to create divs. Im trying to create a style that can be put in the 'Style' dropdown: Ive tried adding the following to my config.js but it seems to have no effect. ``` CKEDITOR.stylesSet.add( 'default', [ // Inline styles { name : 'Titulo Explicacion Servicio', element : 'div', attributes : { 'class' : 'titulo_explicacion_servicio' } }, { name : 'Texto Explicacion Servicio', element : 'div', attributes : { 'class' : 'texto_explicacion_servicio' } }, { name : 'Texto Fondo Foto', element : 'div', attributes : { 'class' : 'intro_fondo_foto' } } ]); ``` I doubt it makes any difference but this is for a Drupal site.

Original source