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

"img { content: image(attr(src as url), "fallback.png"); }"

Surely that rule will be applied regardless of whether the image has loaded or not? CSS inspects the src attribute, not whether it's loaded?

Additionally there is a major point being missed here: it's not just about resource loading from the mark-up, we need control when the CSS image has not loaded too!

The use case is this: better accessibility in scenario's where an author is using "image replacement" techniques but the client has images disabled, or simply didn't load.

Right now we have to use tricks such as text-indent:-999em; to hide text, or use a span to cover the text and set a background on the span.

It'd be nicer (and stop pollution of the mark-up) if CSS were able to tell if a resource had loaded and apply a fallback rule if it hadn't.

I'd tried CSS generated content to do the same job as the span, but could not get it to work.

Received on Friday, 6 January 2012 09:05:33 UTC