css - CKEDITOR 不会调整大小

标签 css ckeditor

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

<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 的 inspect element 功能检查)

我的例子: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>

最佳答案

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

然后在底部 '' 中寻找相应的 JS 行

在您定义了 texarea 之后,JS 接管了工作,所以我认为您需要在 JS 而不是 CSS 中进行编辑。

关于css - CKEDITOR 不会调整大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20734640/

相关文章:

javascript - 如何将CKEditor默认值设置为空白?

CKEditor 自定义插件按钮

javascript - CKEditor keyup 事件并从内联编辑器捕获数据

javascript - 无法附加或发布 CKEditor 值

html - 在徽章内使用 Twitter Bootstrap 下拉控件

jquery - Target 与多个元素具有相同类名的单个元素

php - ckeditor - 无法禁用高级内容过滤器

html - 屏幕尺寸 > 容器尺寸时出现奇怪的宽度问题

css - 在网页中嵌入字体的最佳选择(SEO、速度、交叉兼容性)

javascript - 如何通过javascript动态更改css