gpt4 book ai didi

css - CKEditor 4 结合CSS

转载 作者:行者123 更新时间:2023-11-28 08:07:24 24 4
gpt4 key购买 nike

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

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com