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

> Sure, the fallback text can already be styled. The pseudo-element would only be useful when that text should be styled differently than the replaced content.

As noted above, styling the text differently is already covered by the pseudo-classes introduced in #7467.

> On a related note, [replaced elements](https://drafts.csswg.org/css-display-4/#replaced-element) do not have `::before` and `::after`, but when fallback text is shown, e.g. because fetching an external resource failed, it is not considered a replaced element anymore. Therefore this should work:
> 
> ```css
> img::before { 
>   content: url("custom-image-instead-of-the-default-one.png"); 
> }
> ```

That's an important note. I currently don't see in the specs, whether alt text should be handled as non-replaced element. And browsers also differ, Chrome shows the pseudo-element while Firefox doesn't. And Safari doesn't even display the alt text but shows a broken icon.

So I believe, it first needs to be specified what UAs should display when a resource can't be loaded (or didn't get loaded yet) and whether the alt text is non-replaced content, so the output is unified.

And once that's clarified, it can be discussed whether there's still a need for a pseudo-element and what it should actually cover.

Sebastian

-- 
GitHub Notification of comment by SebastianZ
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13345#issuecomment-3753880603 using your GitHub account


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

Received on Thursday, 15 January 2026 10:01:07 UTC