i'm using old snippet style input placeholder text:
::-webkit-input-placeholder { /* webkit browsers */ color: transparent; } :-moz-placeholder { /* mozilla firefox 4 18 */ color: transparent; } ::-moz-placeholder { /* mozilla firefox 19+ */ color: transparent; } :-ms-input-placeholder { /* internet explorer 10+ */ color: transparent; } and i'm seeing examples of "standard", can't tell if there exists one.
for example https://developer.mozilla.org/en-us/docs/web/css/:-moz-placeholder includes example:
input[placeholder] { text-overflow: ellipsis; } but that's different rule :-moz-placeholder. selecting input placeholder attribute, , not placeholder pseudo-element.
i see references ::placeholder https://css-tricks.com/almanac/selectors/p/placeholder/ can't tell if exists.
afaik there wasn't standard @ time these implementations began popping up. every vendor figuring out on own. hence either pseudo-elements or pseudo-classes, or in case of firefox, breaking change 1 other.
now have bunch of different , incompatible implementations, it's understandably difficult converge them standard can agree on. starters, pseudo-element , pseudo-class different things — author's perspective seem ideal scenario have both: pseudo-class styling input elements have placeholder text, , pseudo-element styling placeholder text itself. needless say, current implementations , documentation don't match expectations either.
the news standardization process has kicked off, both of these things:
- selectors 4 introduces
:placeholder-shownpseudo-class matching elements placeholder text said placeholder text being displayed - the fpwd of pseudo-elements 4 introduces
::placeholderpseudo-element styling placeholder text itself
the naming process minuted here. that's left wait couple of months or years vendors figure out rest.
Comments
Post a Comment