CKEDITOR不会调整大小

时间:2013-12-22 22:17:46

标签: css ckeditor

我有一个当前高度和宽度为auto的ckeditor,但我想修复这些参数。我首先尝试设置行和列,但这不起作用:

<textarea id="editor1" name="editor1" rows="10" cols="10">
    Example text goes here
</textarea>

然后我尝试将配置文件与此代码一起使用(仍然无效):

<script>
    CKEDITOR.editorConfig = function(config) {
        config.height = '100px';
        config.width = '100px';
    };
</script>

使用这两种方法后,ckeditor的高度和宽度仍然是自动的(使用chrome的检查元素功能进行检查)

我的例子:http://strawberrycv.com/test.php

此页面的代码:

<!DOCTYPE html>
<html lang="en">
<head>


  <script src="ckeditor/ckeditor.js"></script>

  <style>
    #ckeWrapper{
        height: 700px;
        width: 600px;
    }

  </style>

</head>
<body>
<form>
<div id='ckeWrapper'>
        <textarea id="editor1" name="editor1" rows="60" cols="90">
            the text goes here
        </textarea>
</div>
        <script>
            // Replace the <textarea id="editor1"> with a CKEditor
            // instance, using default configuration.
            CKEDITOR.replace( 'editor1' );
        </script>



</form>

</body>
</html>

1 个答案:

答案 0 :(得分:-2)

嘿,我刚刚开始使用这个插件,但我想我有一个线索给你: 在这里找到api:http://docs.ckeditor.com/#!/api/CKEDITOR.config

寻找应该位于底部&#39;

的相应JS系列

在你定义texarea JS接管之后,所以我说你需要在JS而不是CSS中进行编辑。

相关问题