[csswg-drafts] [css-pseudo-elements] Extending the scope of `::placeholder` (#13345)

Crissov has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-pseudo-elements] Extending the scope of `::placeholder` ==
The prose for [`::placeholder`](https://drafts.csswg.org/css-pseudo-4/#placeholder-pseudo) 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, 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? 

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13345 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 14 January 2026 07:58:15 UTC