如何更改IE中输入字段中文本光标的颜色?

时间:2022-11-20 23:05:56

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?

根据我的看法,在Firefox和Chrome中,输入字段中文本光标的颜色会更改为“color”css属性的值。但是在IE中它没有任何效果。有没有办法在IE中实现这种效果?

1 个解决方案

#1


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.

IE输入中文本光标的颜色始终与背景颜色相反。所以你不能在IE上。

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

这也是W3C未指定的,所以不要指望支持在任何地方,如果有,那么它只是一个神器:-)

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

编辑:9年后我们现在有插入颜色,但不适用于IE或Edge。适用于其他浏览器。

#1


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.

IE输入中文本光标的颜色始终与背景颜色相反。所以你不能在IE上。

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

这也是W3C未指定的,所以不要指望支持在任何地方,如果有,那么它只是一个神器:-)

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

编辑:9年后我们现在有插入颜色,但不适用于IE或Edge。适用于其他浏览器。