Sometimes you might see a single :, but the may only apply to some vendor specific implementations. While using this site, you agree to have read and accepted our

Examples might be simplified to improve reading and basic understanding. T…

W3Schools is optimized for learning, testing, and training. a sample value or a short description of the expected format).
::placeholder { color: blue; font-size: 1.5em; } Only the subset of CSS properties that apply to the ::first-line pseudo-element can be used in a rule using ::placeholder in its selector.

The ::placeholder selector selects form elements with placeholder text, and let you style the placeholder text. /* Chrome, Firefox, Opera, Safari 10.1+ */

The placeholder attribute specifies a short hint that describes the expected value of an input field (e.g. After some hit and try, I get solution of my problem, but it's amazing. Tip: The default color of the placeholder text …

W3Schools is optimized for learning, testing, and training. I am getting some problem in applying placeholder css. But thanks to the ::placeholder pseudo element you can change this to fit your needs. Just for the record… if anyone requires different coloured placeholders on different elements you can narrow down your selection like this: #first-element ::-webkit-input-placeholder {color: black;} #second-element::-webkit-input-placeholder {color: red;} Examples might be simplified to improve reading and basic understanding. Note that Firefox adds a lower opacity to the placeholder, so we use opacity: 1 to fix this. ::placeholder { Note: In most browsers, the appearance of placeholder text is a translucent or light gray color by default. Normally, HTML input field placeholder text is rendered using default styles and a slightly gray color. Like any psuedo, you can scope it to specific elements as needed, like: input[type="email"].big-dog::-webkit-input-placeholder { color: orange; } Example To change this, style the placeholder with the non-standard ::placeholder selector. ::placeholder { color: red; font-size: 1.5em; } 在使用了 ::placeholder 伪元素的选择器中,仅有小一部分CSS属性可以使用,这个集合可以参考 ::first-line 伪元素。 语法

To change this, style the placeholder with the non-standard If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:

The placeholder text is set with the placeholder attribute, which specifies a hint that describes the expected value of an input field.

Change the color of the placeholder text of an input field:The placeholder text is set with the placeholder attribute, which specifies a color:#898F9C;) on input-box placeholder using pseudo-class selector :-ms-input-placeholder, but it's not working in IE.

Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our

Learn how to change the color of the placeholder attribute with CSS.Use an input element and add the placeholder attribute:In most browsers, the placeholder text is grey. This tutorial shows how to change the placeholder text color of an input of any form.. How to change the placeholder text color of an input. If you are not familiar with pseudo element selectors they are typically prefixed by ::. I am trying to apply css (i.e. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content.