Search code examples
htmlcssplaceholder

color specific placeholder using css


Hi how i can change color to a specific placeholder?

example i got this:

<div class="form-group m-b-15">
<input type="text" id="login" class="form-control form-control-lg no" placeholder="Nº de usuario,Email o cédula" required="" readonly="" value="" autocomplete="off" autofocus="">
</div>

and this

<div class="form-group m-b-15">
<input type="password" class="form-control form-control-lg no" 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


Solution

  • Select Input id and set placeholder style

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