How to Change The Color of The Text Cursor in an Input Field in Ie

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

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.

How to change cursor color without changing text color?

You can make a custom one.

input, textarea {
cursor: url(cursor.cur);
}

How to change background-color of a li if I put the cursor in an input field inside the li?

You can't do this with pure css, you'll need to use javascript / jQuery:

$("input[type='text']").focus(function(){
$("li").removeClass("background");
$(this).closest("li").addClass("background");
});

See: http://jsfiddle.net/HF5Tx/



Related Topics



Leave a reply



Submit