Reputation: 2403
I want to have the cursor #FFF
while my font is #000
.
Is that possible?
Upvotes: 12
Views: 44692
Reputation: 888
From the mozilla docs
/* Keyword values */
caret-color: auto;
caret-color: transparent;
caret-color: currentColor;
/* <color> values */
caret-color: red;
caret-color: #5729e9;
caret-color: rgb(0, 200, 0);
caret-color: hsla(228, 4%, 24%, 0.8);
Upvotes: 9
Reputation: 139
to change caret color CSS of input type text and textarea use below css
input,textarea {
color: #8f0407;
text-shadow: 0px 0px 0px #000 ;
-webkit-text-fill-color: transparent ;
}
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
color: #ccc;
text-shadow: none;
-webkit-text-fill-color: initial;
}
Upvotes: 3
Reputation: 620
Try this
<style>
input {
color: rgb(60, 0, 248); /* change [input cursor color] by this*/
text-shadow: 0px 0px 0px #D60B0B; /* change [input font] by this*/
-webkit-text-fill-color: transparent;
}
</style>
Upvotes: 1
Reputation: 38976
Yes it's easy. Set your font color normally then use a custom cursor.
http://beradrian.wordpress.com/2008/01/08/cross-browser-custom-css-cursors/
That does depend on wether the custom cursor can be color, I'm just assuming it can be.
Upvotes: 4