8

I would like to change the color of the placeholder of my textfield. Here is my code. Thanks in advance

<input type="text" placeholder="input here"/>
0

2 Answers 2

3

Here is jsFiddle for you. Solution

You can use following css to implement the same

::-webkit-input-placeholder { /* WebKit browsers */
  color:    #909;
}
:-moz-placeholder {
  color:    #999;
}
::-moz-placeholder {
  color:    #999;
}
:-ms-input-placeholder {
  color:    #999;
}
0

You can use style to change the color of placeholder.

<input type="text" placeholder="input here" />

Then in your css write-

::-webkit-input-placeholder { /* WebKit browsers */
    color:    Red;
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
    color:    Red;
    opacity:  1;
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
    color:   Red;
    opacity:  1;
}
:-ms-input-placeholder { /* Internet Explorer 10+ */
    color:    Red;
}

See the output in http://jsfiddle.net/w1wjo6q4/1/ Thanks & Regards