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

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