gpt4 book ai didi

javascript - 在 IE9 contenteditable 中显示错误的光标

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

我有一些 html 如下(对于 IE9):

<div contenteditable="true">
Some editable text
<span class="code" contenteditable="true" unselectable="on">uneditable text</span>
more editable text
</div>

在 IE9 中,span contenteditable 必须设置为“true”才能使 span 不可编辑,而在 Chrome 中必须设置为“false”才能使 span 不可编辑!

但是,在 IE9 中,当鼠标经过跨度时,光标显示为移动光标(交叉箭头)。光标在我的 css 文件中设置为“指针”,但这不适用于 IE9。

如何在 IE9 中将光标更改为手形或箭头?

最佳答案

以下内容在 IE9 和 Chrome 38 上都适用,范围内的内容可编辑的,范围外的文本不可可编辑。光标也与您将鼠标悬停在任何文本上时所期望的输入光标相同。

我注意到的唯一区别是,在 Chrome 上,span编辑 模式下以蓝色突出显示。

<div>
Some NOT editable text
<span class="code" contenteditable="true">EDITABLE text</span>
more NOT editable text
</div>

例如,Visual Stidio IDE 上的 HTML5 验证会告诉您 contententeditable 不是元素 div 的有效属性,unselectable 也不是元素 span 的有效属性。

如果您仍然遇到光标问题,请发布您的 CSS。

关于javascript - 在 IE9 contenteditable 中显示错误的光标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27049625/

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