我在表单的 texareas 中使用了 ckeditor,但是网站的背景是黑色的,所以我 想要更改默认样式。 我有基本的工具栏:
CKEDITOR.replace( 'editor1',
{
toolbar : [ [ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-',
'Link', 'Unlink','-']]
});
我要更改的跨度样式是(默认):
<span style="color: rgb(0, 0, 0); font-family: Arial, Helvetica, sans; font-size: 11px;
line-height: 14px; text-align: justify; ">
我在哪里可以更改默认值??
最佳答案
你想要做的是使用自定义样式:
CKEDITOR.addStyleSet( 'myStyles', [
{
name: 'Custom span',
element: 'span',
styles:
{
'color': 'rgb(0,0,0)',
'font-family': 'Arial, Helvetica, sans',
'font-size': '11px',
'line-height': '14px',
'text-align': 'justify'
}
}
]);
CKEDITOR.replace( 'editor1', { styleSet: 'myStyles:/styles.js' } )
参见:http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Styles
关于javascript - 改变ckeditor的<span style>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12382007/