How to set CKEditor 5 height

2019-05-10 20:46发布

问题:

I am using Angular CKEditor 5 component, I knew that setting the editor height is by adding CSS to the Style Sheet file of the component the editor gonna be hosted in.

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

But this is not working! height still sticked to one line noting that when adding the CSS rule mentioned above to the browser console it works!

回答1:

If you add it to the global stylesheet the following should work:

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

But if you want to style through the component.css you need to type this:

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