Applying multiple classes to block level elements in ckeditor

352 Views Asked by At

Is it possible to give a 'p' tag multiple classes via two independent style definitions? Say for instance, a user wants to add the class 'color-blue' to a p tag. And after, they want to add another class 'uppercase' to the 'p' tag.

var one = new CKEDITOR.style( { element: 'p', attributes: { 'class': 'color-blue' } } );
var two = new CKEDITOR.style( { element: 'p', attributes: { 'class': 'uppercase' } } );
editor.applyStyle(one);
editor.applyStyle(two);

it seems like this will overlap the class. what is the right way to do this?

1

There are 1 best solutions below

0
On

No, CKEditor doesn't allow that in their style system.