gpt4 book ai didi

javascript - 使用 TinyMCE 组合内容 css 主体类

转载 作者:太空宇宙 更新时间:2023-11-04 13:09:41 25 4
gpt4 key购买 nike

我正在尝试将一个组合的 css 类设置为 TinyMCE 实例的 content_css 参数。

CSS:

.page.show {
background: red;
padding: 0 0 10px;
}

初始化 JS

<script type="text/javascript">
tinymce.init({
selector: "textarea",
content_css : "/css/frontend/screen.css",
body_class : ".page.show"
});
</script>

但它不起作用,元素在组合的 css 类上工作,我不会复制 css。

最佳答案

您没有尝试添加为选择器(就像在 CSS 中那样),而是尝试用空格分隔类(就像在 html 中那样)。所以你会有以下内容:

<script type="text/javascript">
tinymce.init({
selector: "textarea",
content_css : "/css/frontend/screen.css",
body_class : "page show"
});
</script>

虽然我还没有尝试过,但似乎是个正确的主意。

关于javascript - 使用 TinyMCE 组合内容 css 主体类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24782860/

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