【问题标题】:How to set CKEditor 5 height如何设置CKEditor 5高度
【发布时间】:2018-09-24 18:04:50
【问题描述】:

使用CKeditor angular组件如何设置编辑器高度?

根据文档,可以通过将编辑器样式设置为:

 min-height: 500px !important;

但它不起作用!

【问题讨论】:

    标签: angular ckeditor shadow-dom ckeditor5


    【解决方案1】:

    如果将其添加到全局样式表中,则以下内容应该可以:

    .ck-editor__editable_inline {
        min-height: 500px !important;
    }
    

    但如果您想通过component.css 设置样式,您需要输入以下内容:

    :host ::ng-deep .ck-editor__editable_inline {
        min-height: 500px !important;
    }
    

    【讨论】:

    • 您是将该规则添加到 Ck Editor 样式表文件中还是添加到它所在组件的样式表文件中?
    • 您确定样式已加载?我正在编辑角度示例中的styles.css,它运行良好。
    • aha 现在可以了,我将它添加到组件 CSS 而不是 app styles.css ,这是有线的,谢谢你用你的最后评论编辑答案
    • 哦。你说得对,很抱歉造成混乱,我会用适当的方法更新答案。
    • 如果你想使用第一个选项而不是放入你的全局添加封装 none 到组件。封装:ViewEncapsulation.None
    猜你喜欢
    • 2018-03-15
    • 1970-01-01
    • 2015-10-25
    • 2019-05-24
    • 1970-01-01
    • 2021-10-08
    • 2018-07-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多