I want to change input placeholder color using css. How can I set a new color in input placeholder by input class name
If I define this type of input box on my web page.
<input type="text" name="name" placeholder="Enter your name" class="text_class_name"> <input type="email" name="name" placeholder="Enter your email" class="email_class_name">
If you want to change placeholder color by input class name, then follow this example code.
<style type="text/css"> input[type="text"].text_class_name::-webkit-input-placeholder { /* text_class_name is the input text id name*/ color: #000; } </style>
Or try this if is it helpful for you:
<style type="text/css"> input[type="email"]::-webkit-input-placeholder { color: #ffffff; } input[type="text"]::-webkit-input-placeholder { color: #ffffff; } </style>
Question and answer is powered by AnsPress.io