gpt4 book ai didi

css - 在 tinymce 编辑器中更改所选文本的样式(不是蓝色背景突出显示)

转载 作者:行者123 更新时间:2023-11-28 12:19:02 33 4
gpt4 key购买 nike

如何在 TinyMCE 编辑器中设置用户选择/突出显示文本的背景?我不想要蓝色背景和白色前景的默认选择样式。我该如何改变它?这些是我在TinyMCE主题文件的content.css文件中的拼命尝试,但没有带来任何改变!

.mceContentBody::-moz-selection { background: transparent !important; }
.mceContentBody::selection { background: transparent !important; }
.mceContentBody::-webkit-selection { background: transparent !important; }

#tinymce::-moz-selection { background: transparent !important; }
#tinymce::selection { background: transparent !important; }
#tinymce::-webkit-selection { background: transparent !important; }

:-moz-selection { background: transparent !important; }
::selection { background: transparent !important; }
::-webkit-selection { background: transparent !important; }

p:-moz-selection { background: transparent !important; }
p::selection { background: transparent !important; }
p::-webkit-selection { background: transparent !important; }

span:-moz-selection { background: transparent !important; }
span::selection { background: transparent !important; }
span::-webkit-selection { background: transparent !important; }

请帮忙!

相关TinyMCE元素的HTML代码为:

<iframe>
<html>
<head>...</head>
<body id='tinymce' class='mceContentBody'>...
<p> <span> Here is the text that should have a transparent background when highlighted by the user </span> </p>
</body>
</html>
</iframe>

最佳答案

好的,我可以通过不直接更改 TinyMCE 主题文件来解决这个问题。相反,我在从 tinyMCE init 函数调用的一个外部 CSS 文件中添加了选择 CSS 规则。然后就成功了。

关于css - 在 tinymce 编辑器中更改所选文本的样式(不是蓝色背景突出显示),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16998208/

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