Date and Time Inputs show default placeholder text in solid black and cannot be formatted by CSS pseudo-elements ::placeholder/::-moz-placeholder
Categories
(Core :: Layout: Form Controls, defect, P3)
Tracking
()
People
(Reporter: plutoisaplanet1, Unassigned)
References
(Blocks 1 open bug)
Details
Updated•8 years ago
|
Updated•8 years ago
|
Updated•8 years ago
|
In addition to the pseudo-element ::placeholder being affected, this also affects the pseudo-class :placeholder-shown. I've created a HTML/CSS snippet as an example: https://jsfiddle.net/rw7m2nab/
After checking cross-browser, it appears that no major browser supports this functionality and the default "blank" appearance showing the format of the input is not considered a placeholder. Instead, upcoming pseudo-class :blank should be used once CSSWG Selectors Level 4 is finalized and implemented by browsers.
Comment 3•5 years ago
|
||
Note that the :blank pseudo-class only targets the input field itself, not its placeholder. The issue with the date and time input fields is that their empty texts are treated the same way as normal input text and not like actual placeholders.
So yes, that pseudo-class will let you style the placeholders, though just because of that discrepancy to other input types.
Sebastian
Description
•