2

我在我的网站上使用 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
4

2 回答 2

0

CKEDITOR中,你为你的任何元素写一个<div>标签ol,ul,dl,h1,etc..

只需转到CKEDITOR中的源代码按钮,然后您就可以按照您想要的方式进行编辑。

于 2013-02-05T05:57:03.270 回答
0

就像我在 startpost 上编辑的一样,我自己找到了答案:

将 config.js 更改为:

CKEDITOR.editorConfig = function( config ) {
    config.bodyClass = 'content'; //class that body needs to refer to
    config.contentsCss = '/css/beheer.css'; //your stylesheet
于 2013-03-14T12:49:43.893 回答