How Do I Add Custom Styles Based on CSS Classes?

Add a style definition as described in the How do I customize the Styles drop-down list? article and pass the class name in the attributes parameter.

important note

Do remember that since class is a resereved word in JavaScript, you need to place it in quotes.


The following example adds a myClass class to an img element. The image element will now be styled as defined in this CSS class.

{
	name : 'Custom Image',
	element : 'img',
	attributes : { 'class' : 'myClass' }
}

For more details on the definition format and best practices on how to customize the styles please refer to the Styles article from the Developer's Guide.

This page was last modified on 9 March 2011, at 07:53.