我在我的网站上使用 CSS 来设置项目的样式。
在我(自己开发的)CMS 中,我使用 CKEditor 作为所见即所得的编辑器。
我希望编辑器与我网页上的内容具有相同的样式。我页面的 CSS 如下所示:
.content
{
...
}
.content ul, .content ol
{
...
}
.content p
{
...
}
但是 CKEditor (contents.css) 的样式表是这样的:
body
{
...
}
ol,ul,dl
{
...
}
h1,h2,h3,h4,h5,h6
{
...
}
有没有办法把它放到一个样式表中,或者编辑CKEditor,所以添加了一个div.content?
我找到了答案,将 config.js 更改为:
CKEDITOR.editorConfig = function( config ) {
config.bodyClass = 'content'; //class that body needs to refer to
config.contentsCss = '/css/beheer.css'; //your stylesheet