W3C home > Mailing lists > Public > www-style@w3.org > April 2008

Re: fallback color for background-image (ISSUE-5)

From: David Woolley <forums@david-woolley.me.uk>
Date: Sun, 06 Apr 2008 10:17:35 +0100
Message-ID: <47F8952F.9060804@david-woolley.me.uk>
To: www-style@w3.org

Patrick Garies wrote:

> h1 { background: transparent url("image.png"); }
> @missing resource("image.png") { /* missing is a synonym for disabled, 
> blocked, unsupported, malformed, inaccessible, incomplete, etc. 
> resources */
>    h1 { background-color: black; }
> }

You would have to tie the h1 and @missing lines together, so that the 
@missing group is only obeyed if the h1 group would have won in the cascade.

Note that this example is degenerate in that the only selector in the 
@missing block is h1, but that would have to be enforced, if one was to 
avoid other selectors being introduced that were incompatible with a 
subsequent, or !important, h1 rule that changed the background image to 
one that did exist.

David Woolley
Emails are not formal business letters, whatever businesses may want.
RFC1855 says there should be an address here, but, in a world of spam,
that is no longer good advice, as archive address hiding may not work.
Received on Sunday, 6 April 2008 09:18:17 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:04 GMT