0

Can I apply css to the part of place holder in text box ?

<input name="name" placeholder= "Enter my name"> </input>

can I change the color of name in to red. But I want to apply color only to the specific word only.

samm
  • 33
  • 1
  • 1
  • 7

1 Answers1

0

This might help you

<input id="name" name="name" placeholder= "Enter my name"> </input>

//chrome, opera, safari
#name::-webkit-input-placeholder:after {
   content:"name";
   color:red;
}

//mozilla firefox
#name::-moz-placeholder:after {
    content:"name";
    color:red;
}

//internet explorer
#name:-ms-input-placeholder:after {     
    content:"name";
    color:red;
}
Deepak Terse
  • 652
  • 8
  • 30