How do I change the color of the text cursor in an

2019-02-21 09:32发布

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?

1条回答
等我变得足够好
2楼-- · 2019-02-21 10:16

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.

查看更多
登录 后发表回答