如何在IE中使用'contenteditable'属性更改元素上的光标样式? [英] How to change cursor style on element with 'contenteditable' attribute in IE?

查看:668
本文介绍了如何在IE中使用'contenteditable'属性更改元素上的光标样式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 < p>< p>< p>< ; div contenteditable =truestyle =cursor:pointer;> 
text
< / div>

我曾尝试使用上例中的内联样式,也使用css文件和javascript。没有运气。



我的所有解决方案都可以在FF中正常工作,它们在IE中也能正常工作,但只有当'contenteditable'属性设置为false时才能正常工作。所以这肯定与IE中contenteditable的实现有关,但我不知道如何解决这个问题。



我使用IE8。



感谢您的帮助!

解决方案

这取决于你有没有chossen的DTD。似乎你使用默认的严格DTD。



以下是可能的声明
查看7.2 HTML版本信息。



我尝试过:

 <!DOCTYPE HTML PUBLIC -  // W3C // DTD HTML 4.01 Transitional // EN> 

它很好用,但它不适用于下一个声明:

 <!DOCTYPE HTML PUBLIC -  // W3C // DTD HTML 4.01 // ENhttp://www.w3.org/TR /html4/strict.dtd\"> 

希望它有帮助,您可以在其他布局中使用该DTD而不会出现问题。


I am trying to change style of cursor on element that has 'contenteditable' attribute set to true in IE.

<div contenteditable="true" style="cursor:pointer;">
        text
</div>

I have tried do that using inline styling like in example above, also with css file and by javascript but with no luck.

All my solutions work in FF without problems, they work fine also in IE but only when 'contenteditable' attribute is set to false. So it is definitely somehting related with implementation of contenteditable in IE but I have no clue how to solve this problem.

I am using IE8.

Thank a lot for your help!

解决方案

it depends on your DTD you have chossen. Seems you use default strict DTD.

Here is reference for possible declarations: look to 7.2 HTML version information.

I tried with:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

and it works great, but it don't works with next declaration:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

Hope it helpful and you can use that DTD without issues on another layouts.

这篇关于如何在IE中使用'contenteditable'属性更改元素上的光标样式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆