CKEditor remove style preview from Styles dropdown

萝らか妹 提交于 2019-12-08 01:41:49

问题


I've been searching and searching for an answer to this problem and cannot found a solution.

I have added some custom styles to the CKEditor that add a margin-left to the selected text. The problem is that this causes the style previews to move to the right in the styles list. So much so, that they go off the right side of the dropdown. I don't quite have enough rep to post a screenshot unfortunately.

I would just like the styles in the list to have no preview at all if possible.

I have tried to add .cke_panel_listItem p {margin-left: 0px !important;} to my global.css and to the editor.css. I cannot override the inline style no matter what I do.

Any suggestions? Thanks in advance!


回答1:


I was able to do this using the contentsCss config property. So:

CKEDITOR.editorConfig = function( config ) {
  config.contentsCss  = 'wysiwyg.css';
}

then in wysiwyg.css put your CSS code:

.cke_panel_listItem p {
  margin-left: 0px !important;
}


来源:https://stackoverflow.com/questions/10435725/ckeditor-remove-style-preview-from-styles-dropdown

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!