Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hide caret (text cursor) on contenteditable div in internet explorer

I have contenteditable div on which i have file drop and copy-paste image event. By using the color:transparent i am able to hide the blinking cursor on chrome browser. but in IE i came to know "The color of the text cursor in an input on IE is always the inverse of the background color". Source:How do I change the color of the text cursor in an input field in IE?

Is there any alternative way to disable a cursor or change the speed of blinking cursor so it looks like hidden in IE.

like image 660
AmolP Avatar asked Sep 06 '16 09:09

AmolP


2 Answers

You can do it in CSS with:

caret-color: transparent

Doesn't work in IE though. Here is browser support chart.

like image 163
Lewis Donovan Avatar answered Nov 16 '22 05:11

Lewis Donovan


You can do this for IE with this hack:

color: transparent;
text-shadow: 0 0 0 #333333;

You can replace the color (#333333) with whatever text color you need.

like image 42
user2173353 Avatar answered Nov 16 '22 03:11

user2173353