W3C home > Mailing lists > Public > www-style@w3.org > March 2005

Re: Stand-in color before images load

From: Matthew Raymond <mattraymond@earthlink.net>
Date: Tue, 29 Mar 2005 16:22:55 -0500
Message-ID: <4249C72F.6080505@earthlink.net>
To: Laurens Holst <lholst@students.cs.uu.nl>
CC: www-style@w3.org

Laurens Holst wrote:
> Matthew Raymond wrote:
>>  Perhaps what we need is "alt" styling...
>>
>>| p { background: transparent url("marble.png"); }
>>| p:alt { background-color: black; }
> 
> I don’t know if that would work...
> 
> p { background: transparent url("marble1.png");
>      content: url("marble2.png"); }
> p:alt { background-color: black; }
> 
> When will the :alt be visible, marble1.png fails to load, or 
> marble2.png, or both?

    I guess both. Just ":alt" would be a general file load failure. 
Really, what we need is to be able to feed a property name to :alt to 
pick a specific property that triggers the alternative styling.

| p {
|   background: transparent url("marble1.png");
|   content: url("marble2.png");
| }
|
| p:alt(background-image) { background-color: black; }
| p:alt(content) { content: "Image failed to display: marble2.png"; }
| p:alt(background-image):alt(content) { color: white; }


> Also, this is just about images not loading, right?

    I suppose it could be generalized to files not loading...

 > There are a limited amount of /properties/ with which you can
> load images. Is it logical to ‘fix’ something done by properties with a 
> selector?

    It is if you want something more sophisticated than a canned, single 
property solution.

> Wouldn’t it be easier to introduce an equally limited amount 
> of properties for this specific functionality?

   Not necessarily. Depends on the user agent architecture and the 
nature of the new properties. If you have to test to see if the 
properties apply, though, I would assume you could roll that test into a 
CSS selector.

 > Also, I think this would
> then be the first selector which becomes valid based on the state of CSS 
> itself. What if you load an image inside an :alt selector?

    Forbid image loading for properties of :alt. There's no reason to 
have them anyways, since the idea is that the images can't be loaded.

    Then again, you could have situations where a specific image format 
won't load. I think that perhaps a different solution would be better 
for that, though. Perhaps something like this:

| p { background: transparent url("marble.png", "marble.gif"); }

> Replace the p with img and you’ve got an even more complex case.

    :alt(self)???
Received on Tuesday, 29 March 2005 21:22:45 GMT

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