::placeholder - Selector CSS
Summary of characteristics of the ::placeholder selector
placeholder attribute).Description of the ::placeholder pseudo-element.
The ::placeholder pseudo-element is a selector that targets the placeholder text displayed in the input boxes.
This placeholder text is specified by the placeholder attribute of the input and textarea tags.
In the case of input tags, the placeholder attribute is only taken into account for types with a free-entry field:
text, number, date, etc.
The placeholder text can be used to tell the user what information should be entered here or in what format it should be entered.
If the placeholder text is empty, or if there is no placeholder attribute in the input tag, the properties of
::placeholder are not applied.
The placeholder text disappears as soon as the operator enters a first character.
The same is true for the effect of properties applied to ::placeholder.
input type="text" placeholder="Town"
input type="text" placeholder="jj/mm/aaaa"
input type="text" placeholder="Age (18 to 70)"
::placeholder targeting placeholder text, few properties are applicable: font-related properties, color, background properties,
and a few others.
There is also a pseudo-class named :placeholder-shown that targets input boxes with placeholder text.

Examples of use of ::placeholder.
The text that currently appears in the four input boxes below is the placeholder text. It disappears if you start typing, along with the formatting associated with it.
Browsers compatibility.
The pseudo ::placeholder element is properly handled by current browsers. Refer to the compatibility table below.
::placeholder pseudo-element, targeting the informational text of an input box.::placeholderpseudo-element
Browsers on computers :
Mobile browsers :
Outdated or marginal browsers :

Internet Explorer

UC Browser pour Androïd

Opéra Mobile

QQ Browser

Baidu Browser

Samsung Internet

Chrome

Edge

Safari

Firefox

Opéra

Safari sur IOS

Androïd Brower

Firefox pour Androïd

Chrome pour Androïd

KaiOS Browser

Opéra mini
::placeholder pseudo-element historic.
-
CSS Pseudo-Elements Module Level 4
Regarding::placeholder. Introduction of the::placeholderpseudo-element.January 15, 2015Working Draft.
Other pseudo-elements.
The ::placeholder pseudo-element is presented in the CSS Pseudo-Elements Module , along with the following:
Selectors:




placeholder attribute).





