我在我的网站上使用 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
最佳答案
在 CKEDITOR 中,你写了一个 <div>
您的任何 ol,ul,dl,h1,etc
的标签元素..
只需转到 CKEDITOR 中的源代码按钮,然后您就可以按照自己的方式进行编辑。
关于css - CKEditor 4 结合CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29432475/