Hi,
I've added styles to my CKEditor as follows:
config.stylesSet = [ { name: "Red Text", "element": "span", attributes: { "class": "red" } }, { name: "White Text", "element": "span", attributes: { "class": "white" } }, { name: "Red Block", "element": "p", attributes: { "class": "red" } }, { name: "White Block", "element": "p", attributes: { "class": "white" } } ]
This results in the current block changing to a <p>-element block when selecting the "White Block" or "Red Block" styles.
But what I'd actually want to do, is adding a class to the current block, regardless of the type (element) of the block (Normal, Heading 1, Heading n, ...). I'm looking for something like this:
{ name: "Red Block", "element": "*", attributes: { "class": "red" } }, { name: "White Block", "element": "*", attributes: { "class": "white" } }
So the expected result (when choosing "Red Block") would be:
<p>Hello world!</p> <!-- would change to: --> <p class="red">Hello world!</p> <!-- and --> <h3>Headline</h3> <!-- would change to: --> <h3 class="red">Headline</h3>
And all this without having to define a style for every type of element. Is that possible?
Thanks for your help in advance! :)
Regards,
renet