Home > Net >  color specific placeholder using css
color specific placeholder using css

Time:07-05

Hi how i can change color to a specific placeholder?

example i got this:

<div >
<input type="text" id="login"  placeholder="Nº de usuario,Email o cédula" required="" readonly="" value="" autocomplete="off" autofocus="">
</div>

and this

<div >
<input type="password"  id="password" placeholder="Contraseña" required="" autocomplete="off" value="">
</div>

i just need to change placeholder of the first input text of my form.

i had tried the following code:

#login input#text::-webkit-input-placeholder {color:#ff5b57;}
#login input#text::-moz-placeholder          {color:#ff5b57;}
#login input#text:-moz-placeholder           {color:#ff5b57;}
#login input#text:-ms-input-placeholder      {color:#ff5b57;}

but is not working, what im doing wrong?

thank you

CodePudding user response:

Select Input id and set placeholder style

    input#login::placeholder {
        color: red;
        font-size: 15px;
    }
<div >
<input type="text" id="login"  placeholder="Nº de usuario,Email o cédula" required="" readonly="" value="" autocomplete="off" autofocus="">
</div>

CodePudding user response:

This should be like below

#login::-webkit-input-placeholder {color:#ff5b57;}
#login::-moz-placeholder          {color:#ff5b57;}
#login:-ms-input-placeholder      {color:#ff5b57;}
  • Related