You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The prose for ::placeholder currently clearly limits its use to placeholders that eventually get replaced by user input, i.e. within form widgets. Conceptually, I think it could equally apply to “alternative” text that is displayed instead of replaced elements when their replaced content cannot (yet) be rendered – most notably the alt attribute of <img> elements in HTML. Although there have been pseudo-classes proposed to select such elements #3134, there currently does not seem to be a way to select and style only this kind of placeholder (unless it comes from a descendant element instead of an attribute in the host document language, e.g. within <audio>, <video> or <object>).
Should the scope of ::placeholder be broadened to include alternative text?
In case it shan’t, should a new pseudo-element be introduced to represent alternative text?
Would a combination of pseudo-element and (new) pseudo-classes, e.g. ::content:textual vs. ::content:replaced, yield more useful options for authors?
(Even though its scope is different, this should be considered together with the longstanding ::text proposal. [css-pseudo-5] ::text / ::text-node pseudoelement #2208)
The prose for
::placeholdercurrently clearly limits its use to placeholders that eventually get replaced by user input, i.e. within form widgets. Conceptually, I think it could equally apply to “alternative” text that is displayed instead of replaced elements when their replaced content cannot (yet) be rendered – most notably thealtattribute of<img>elements in HTML. Although there have been pseudo-classes proposed to select such elements #3134, there currently does not seem to be a way to select and style only this kind of placeholder (unless it comes from a descendant element instead of an attribute in the host document language, e.g. within<audio>,<video>or<object>).::placeholderbe broadened to include alternative text?::content:textualvs.::content:replaced, yield more useful options for authors?(Even though its scope is different, this should be considered together with the longstanding
::textproposal. [css-pseudo-5] ::text / ::text-node pseudoelement #2208)