Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to change placeholder color ?

    • 0
    • 2
    • 2
    • 1
    • 0
    • 0
    • 0
    • 0
    • 521
    Comment on it
    Hi all,
    Many time we need to change the input placeholder color or style so here is an pseudo element ::placeholder which can helps you. placeholder defult color is gray with 0.6 opacity so if your input background color is dark in gary, your placeholder will not shown properly.

    But ::placeholder make the way easy.

    Example:-

    css:-

    :-moz-placeholder { /* Firefox 19+ */
        color: red;
       opacity: .8
    }
    

    Html:-

    <input type="text" placeholder="Placeholder">
    

    Output :-




    Syntax for different browser -

    ::-webkit-input-placeholder {
      color: Green;
    }
    ::-moz-placeholder { /* Firefox 19+ */
      color: Green;
    }
    :-moz-placeholder { /* Firefox 18- */
      color: Green;
    }
    :-ms-input-placeholder {
      color: Green;
    }
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: