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

1

12

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?

Unknowing answered 26/3, 2009 at 8:47 Comment(3)
Same problem on my page (lonniebest.com/FormatCSS). When you hover the cursor in the textarea, it blends in with the background. Annoying; it should act as you say above: be what ever color the "color" property is.Alltime
@Lonnie: How can you hover the caret?Spires
@Spires your answer is valid. Still whats the overcome for this?Sarajane
S
20

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.

Spires answered 26/3, 2009 at 9:14 Comment(3)
This is still not implemented, but there is now a spec for this: dev.w3.org/csswg/css-ui/#caret-colorTamar
Since IE Edge v79 (Jan 2020) we are able to use the CSS rule caret-colorFibrosis
@mryuso92: Well, that's the Chromium-based Edge, so neither Trident, nor EdgeHTML ever gained support for this. Which was what this question was about.Spires

© 2022 - 2024 — McMap. All rights reserved.