Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change the color of the text cursor in an input field in IE?

From what I saw, in Firefox and Chrome, the color of the text cursor in an input field changes to the value of the color css property. However in IE it has no effect whatsoever.

Is there any way to achieve this effect in IE?

like image 921
krulik Avatar asked Mar 26 '09 08:03

krulik


People also ask

Can I change cursor color CSS?

The contenteditable is an attribute that you can apply to any element to make them editable. Now you will have a blinking cursor on the element and you can apply a custom color on it.


1 Answers

The color of the text cursor in an input on IE is always the inverse of the background color. So you can't on IE.

This is also unspecced by W3C so don't expect support to be anywhere, if there is, then it's merely an artifact :-)

Edit: 9-years later and we now have caret-color, but not for IE or Edge. Works on other browsers.

like image 198
Joey Avatar answered Oct 02 '22 16:10

Joey