Skip to content

Instantly share code, notes, and snippets.

@lichenbuliren
Forked from JoeKeikun/input_cursor_color
Created July 26, 2016 05:50
Show Gist options
  • Save lichenbuliren/9e810599a88576f4e0bbf791139c0e94 to your computer and use it in GitHub Desktop.
Save lichenbuliren/9e810599a88576f4e0bbf791139c0e94 to your computer and use it in GitHub Desktop.
How to change <input> input cursor color by css (webkit)
When I developed an app for ios by phonegap, I had a trouble in changing the <input> input cursor color.
but now, there is a solution for it:
---------------
<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>
---------------
this will change placeholder's color too. If we also need to change placeholder's color after this, we can use this:
---------------
<style>
input::-webkit-input-placeholder{
color: rgb(60, 0, 248); /* change [placeholder color] by this*/
text-shadow: none;
-webkit-text-fill-color: initial;
}
</style>
---------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment