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

> Something like `img:broken { background-image: url("custom-image-instead-of-the-default-one.png"); }` would cover that I think.

I agree with that. Though this also means to streamline how implementations expose their broken image state. E.g. Chromium outputs the broken image as a separate element and not as a background image, presumably to avoid overlaps with the alternative text.

And depending on whether and how we define the broken state/fallback content to be exposed, it affects whether we need a pseudo-element for it.

> My concern with widening what `::placeholder` applies to is that any existing pages with a bare `::placeholder { something }` style rule might have unexpected effects that they don't want to apply to image fallback text.

+1 on that. Also, the use case seems different to me. The alternative text is not a placeholder for the image. It has semantic meaning for accessibility. So if a pseudo-element is meant to cover this, a new one should be introduced. The HTML spec calls this ["fallback content"](https://html.spec.whatwg.org/multipage/dom.html#fallback-content), so maybe it could be `::fallback`.

Sebastian

-- 
GitHub Notification of comment by SebastianZ
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13345#issuecomment-3749344976 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 12:29:25 UTC