0

フォームの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; ">

デフォルト値はどこで変更できますか?

4

2 に答える 2

1

あなたがしたいことは、カスタムスタイルを使用することです:

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

于 2012-09-14T14:33:42.990 に答える
0
<textarea cols="100" id="editor1" name="editor1" rows="10">This is some sample text</textarea>

<script type="text/javascript">
    // Replace the <textarea id="editor1"> with an CKEditor instance.
    var editor = CKEDITOR.replace( 'editor1' );
    editor.on( 'instanceReady', function( ev ){
        //set the background properties
                this.document.$.childNodes[1].childNodes[1].style.backgroundColor = 'Blue';

                editor.focus();
        });
</script>
于 2012-09-12T06:36:45.477 に答える