从CDN

时间:2016-04-12 22:20:04

标签: php html ckeditor

我已经通过CDN(https://cdn.ckeditor.com/)将CKEditor添加到我的PHP项目中以替换当前的textareas。

我把它链接在适用文件的头部:

<script src="//cdn.ckeditor.com/4.5.8/standard/ckeditor.js"></script>

在我的main.js文件中,我已经替换了textareas:

CKEDITOR.replace('message');
CKEDITOR.replace('address');
CKEDITOR.replace('note_message');
CKEDITOR.replace('reminder');
CKEDITOR.replace('save_the_date_message');
CKEDITOR.replace('thank_you_message');

//trial code
CKEDITOR.config.width = 600;

我已经搜索并尝试阅读文档,但无法弄清楚如何调整每个文本区域的高度/宽度。这是我文件的当前外观:

mypic

非常感谢任何有关如何解决此问题的见解。

1 个答案:

答案 0 :(得分:2)

要更改它的大小,您只需更改它的HTML代码即可。例如:

<textarea name="editor"></textarea>

在此代码中,您有文本区域,要调整大小,请使用以下CSS:

<textarea name="editor" style="width:400px; height:500px;"></textarea>

或者:

<textarea name="editor1" width="400" height="500"></textarea>

但是,如果你想用javascript调整它的大小,请使用以下代码:

CKEDITOR.replace('editor', {
  width: '400',
  height: 500
});

此致 LucasS.Müller。