W3C home > Mailing lists > Public > www-style@w3.org > January 2012

Re: [css4-ui]/[css4-selectors] Pseudo-class for selecting broken images & other external resources

From: Edward O'Connor <eoconnor@apple.com>
Date: Thu, 05 Jan 2012 12:09:20 -0800
To: www-style@w3.org
Message-id: <m2aa61ud1r.fsf@eoconnor.apple.com>
Tab wrote:

> If the only use-case is replacing broken <img> tags with a fallback,
> then, this can be done with a rule like:
>
> img { content: image(attr(src as url), "fallback.png"); }
>
> or, to simply hide broken images:
>
> img { content: image(attr(src as url), transparent); }

[...]

> Are there use-cases for anything further?

Consider a layout in which images have a shadow.

img {
  box-shadow: 4px 4px #999;
}

It'd be nice to be able to turn off the shadow if the image hasn't
loaded yet or couldn't be loaded.

img:something {
  box-shadow: none;
}


Ted
Received on Thursday, 5 January 2012 21:12:49 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:08 UTC