4

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!

user461526
  • 43
  • 3
  • I'm having the same issue in IE, did you find the solution? without chaging DTD, i'm using html5 DocType – Fraga Apr 03 '13 at 19:15
  • 1
    @Fraga I've faced this too, but unfortunately I wasn't able to find a good solution for that. I've just filled a ticked in MS connect platform https://connect.microsoft.com/IE/feedback/details/1070215/cant-change-cursor-in-contenteditable-using-css – Marek Lewandowski Dec 30 '14 at 10:31
  • facing same issue ,unable to have copy cursor on editable div – Vivek Panday Jun 10 '15 at 08:15

1 Answers1

1

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.

mastak
  • 1,397
  • 1
  • 14
  • 28
  • Yes, that's it. It works now, thanks a lot! On the other hand it would be better if IE allow us to change it without any restrictions on DTD. – user461526 Oct 01 '10 at 10:21