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

别等时光非礼了梦想. 提交于 2019-12-19 13:08:36

问题


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:


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.



来源:https://stackoverflow.com/questions/684972/how-do-i-change-the-color-of-the-text-cursor-in-an-input-field-in-ie

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!