Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding inline styles to multiple elements in ckeditor

I need to add inline style to multiple html elements using the inline style option in the ckeditor. I have added the following code in the styles.js file.

 { name: 'Red italics', element: 'p', styles: {'font-style' : 'italic', 'color' : '#632423'} },

I need to add the styling to multiple html tags , something like the below

{ name: 'Red italics',  element: 'p, div, li', styles: {'font-style' : 'italic', 'color' : '#632423'} },

but this does not work. Can anyone please tell me how can I do the above.

Thanks in advance.

Regards,

Neha

like image 622
Neha Dangui Avatar asked Nov 01 '25 17:11

Neha Dangui


1 Answers

Please try this solution..

{ name: 'Red italics', element : ['p', 'div', 'li'], styles: {'font-style' : 'italic', 'color' : '#632423'}  }

let me know if it helps you...

EDIT

if that does not work then try below code

{ name: 'Red italics', element : ['p', 'div', 'li'], attributes: {'font-style' : 'italic', 'color' : '#632423'}  }
like image 60
Nishant Solanki Avatar answered Nov 03 '25 07:11

Nishant Solanki